关于Android中的ListView在屏幕旋转后消失的问题解答
当我们在onConfigurationChanged方法中执行setContentView时,将重新创建ListView。您需要再次将数据加载到ListView中。如果将ListView绑定到适配器,则需要在onConfigurationChanged中执行此操作。
在清单文件下的活动中使用configChanges。 <activity ... ... android:configChanges="orientation|screenSize|keyboard"> </activity >
浙公网安备 33010602011771号