Ann
Ann

Reputation: 737

Set images randomly in the grid in Android

I am using a version of the "Grid View" example from the Android Developers site: http://developer.android.com/resources/tutorials/views/hello-gridview.html And I would like to display images in reach grid randomly and the image position will change in each click. Can someone please give an example of how this might be accomplished (i.e. what needs to be edited)? Thanks!

Upvotes: 1

Views: 1105

Answers (1)

rekire
rekire

Reputation: 47965

You need to implement a custom ListAdapter, where you need to check which items are visible and select then a random image which is not visible. Bute note that a total random list will confuse your users. Better sort your images by random and visualizate them same in one instance.

Upvotes: 1

Related Questions