简体   繁体   中英

Android - A way to trigger onRetainNonConfigurationInstance?

Is there a way to trigger the calling of onRetainNonConfigurationInstance on my activity, so getLastNonConfigurationInstance() returns something the next time the activity is created?

I ask because I have a memory leak in my application which only appears/crashes my app after my phone is left idle for hours, so I believe the issue is here.

Force Stop in Settings does not cause this. Any help would be greatly appreciated as i've spent days chasing red herrings to catch this bug.

如果您遇到内存泄漏,建议您管理这些内存泄漏,而不是强制旋转屏幕。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM