开发者

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.


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜