开发者

onPause, onResume events in Android

I need to simulate a part of the lifecycle, from onPause to onResum开发者_JAVA技巧e event.

I used the back button to pause the app, when I enter the app again, it always to the onCreate event to start a new lifecycle.

How to make the app run from onPause to onResume directly ?

Thanks.

onPause, onResume events in Android


well android use back button to remove activity from stack.

but if you don't want to remove activity from stack you can use home key for returning from app.

but if you still want back button to work like home button then you can refer here


try opening a dialog on press of a button. This will call the onPause. Close the dialog onResume will be called. Start a new activity onPause followed by onStop called. Press back onResume called

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜