设置Android图库小工具来显示特定图像开始小工具、图像、图库、Android

2023-09-09 21:12:35 作者:*本宫要—维护—后宫和平*

我有个任务,用户可以从一个GridView重新presenting相册选择图像,并从这个我开始它显示一个画廊控件来显示相册的图像的新活动。不过,我似乎无法得到图库部件显示相册的内容与给定的形象为出发点。理想情况下,我想一个画廊#setStartingImage(INT位置)或类似的东西。

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 like a Gallery#setStartingImage(int position) or something similar.

任何意见将大大AP preciated。

Any ideas would be greatly appreciated.

推荐答案

看起来有点深入画廊的继承层次后,我发现该方法setSelection(),其中库扩展AbsSpinner类中定义。这似乎做的工作。

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.