开发者

Set Android Gallery widget to show specific starting image

开发者 https://www.devze.com 2022-12-20 23:29 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号