开发者

Android - A way to trigger onRetainNonConfigurationInstance?

开发者 https://www.devze.com 2023-04-05 09:36 出处:网络
Is there a way to trigger the calling of onRetainNonConfigurationInstance on my activity, so getLastNonConfigurationInstance() returns something the next time 开发者_运维知识库the activity is created?

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.


if you are having memory leaks I suggest that you manage those memory leaks instead of forcing the rotate of the screen.

0

精彩评论

暂无评论...
验证码 换一张
取 消