Set Android Gallery widget to show specific starting image
I have a task where the user can select an image from a GridView representing a photo album, and from this I start a new activity which displays a Gallery widget to show the images of the photo album. However, I can't seem to get the Gallery widget to show the contents of the photo album with a given image as the starting point. Ideally I would l开发者_运维问答ike a Gallery#setStartingImage(int position) or something similar.
Any ideas would be greatly appreciated.
After looking a little deeper into the inheritance hierarchy of Gallery, I found the method setSelection() defined in the AbsSpinner class which Gallery extends. This seems to do the job.
精彩评论