Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我拍了一张照片,它被放置到一个 ImageView 上。当用户看到 Image View 所在的页面时,我将手机横向转动到水平方向时,应用程序立即返回到应用程序的主屏幕。有任何想法吗?
旋转手机会重新创建活动。实施onSaveInstanceState()和onCreate()方法来正确保存和恢复活动的状态应该可以解决问题。
onSaveInstanceState()
onCreate()