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.
在 android 中,锁定和解锁手机后,活动会暂停并恢复。那时列表视图变为空。请帮助我在 onPause 中保存值并在 onResume 中检索它...
提前致谢
尝试将内容放入列表视图中,onResume()而不是您的onCreate()方法或其他方法。甚至保存实例也是@Drooling_Sheep 所说的一种选择。
onResume()
onCreate()