android按后退按钮的画廊问题
嗨,团队前夕,我有一组图像,例如 1 2 3 4 5 6。单击 1(即第一张图像)时,该图像应该在另一个活动中显示。当我们用手指滑动时,它应该移动到下一个图像。如果我在按下设备上的后退按钮时停止在图像位置 4. 附近滑动。主 Activity 应显示在 4 的位置附近。
我已经在 onFling() 的帮助下完成了滑动。问题是当我按下后退按钮时,图像移动到第一个位置。我需要在相同的位置......
提前致谢
Hie team gud eve, I had a set of images like 1 2 3 4 5 6. on clicking on 1 (i.e first image) the one should show in another activity. When we swipe with the finger it should move to the next image. If i stop swiping near the image position 4. while pressing the back button on the device. The main Activity should show near the position of 4.
I already done with the swipe with the help of onFling(). The problem is when i press the back button the image is moving to the first position.I need in the same position......
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的目标是 Android 2.0 或更高版本,则可以使用
onBackPressed()
来决定按下后退按钮时会发生什么。这比较容易做到。要选择图库中的项目:
If you're targeting Android 2.0 or newer, you can use
onBackPressed()
to decide what happens when you hit the back button. This is slighlty easier to do.To select a item in the Gallery: