How to create an array of images

+1 William Kalu · January 13, 2016
How can I create an array to list different images. I mean creating an array like to the one in tutorial 46 to 48. Most in importantly how to make changes to the code so that the images will appear. I need a solution, please.

Post a Reply

Replies

Oldest  Newest  Rating
0 Gary Whitney · January 13, 2016
Lesson 48 used
ImageView buckysImage = (ImageView) customView.findViewById(R.id.my_profile_image);
which produced the same image for each cardview.
I believe he even said something like "I'll leave it to you to put different images."

If you are looking for some code to copy and paste, I can't help you.

But if you are looking for ideas...
You create an array of Integers (e.g. Integer[] imageArray) and populate it with R.id,anImageIDs i.e. the ids of the images you stored in your app.
   then
ImageView buckysImage = (ImageView) customView.findViewById(R.id.my_profile_image);
becomes
ImageView buckysImage = (ImageView) customView.findViewById(imageArray[index]);
0 Shukri Shauqei · January 14, 2016
Hello there.. Same problem here.. thanks for the help.
  • 1

Java / Android Development

107,134 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator