待机后,重新进入,发现数据丢失,通过打印信息发现,原来是activity被回收掉了。为了避免数据的丢失,在androidmanifest.xml的activity中加入android:configChanges="orientation|keyboardHidden|screenSize"
转载于:https://blog.51cto.com/laocai/1622868
待机后,重新进入,发现数据丢失,通过打印信息发现,原来是activity被回收掉了。为了避免数据的丢失,在androidmanifest.xml的activity中加入android:configChanges="orientation|keyboardHidden|screenSize"
转载于:https://blog.51cto.com/laocai/1622868