开发者

Method ran when user press Back key on Android

I'm developing an Android 2.2 application.

I want to know which activity method is ran when user press b开发者_如何学Pythonack key.

I have found this: "When the user presses the BACK key, the current activity is popped from the stack, and the previous one resumes as the running activity. "

But it doesn't tell what method is ran.

Thanks.


In Android 2.2, pressing the BACK button triggers onBackPressed() in your activity. The default implementation of onBackPressed() calls finish().


onKeyDown and onBackPressed

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜