Android的生命周期法 [英] Android life cycle method

查看:115
本文介绍了Android的生命周期法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


什么是当一个活动是从另一个活动开始,还应该在对应home键点击要执行的方法android的生命周期方法执行。
有什么方法来检测用户pressed一个home键?
在存在任何独特的方法thatexecute为home键的一部分,我没有意思home键监听器?

Hi What are the android life cycle method executed when an activity is started from another activity and also the method that should be executed in corresponds to home button click. Is there any way to detect that user has pressed a home button ? is there exist any unique method thatexecute as part of home button,am not meaning home button listener?

推荐答案

Android的活动周期。 OnCreate中被称为在新的活动,对的onPause旧的。

Android Activity lifecycle. OnCreate is called on the new activity, onPause on the old one.

您无法捕捉的home键preSS,或用它做什么,但的 onUserLeaveHint 被称为一个供参考。

You can't capture the home button press, or do anything with it, but onUserLeaveHint is called as an fyi.

这篇关于Android的生命周期法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆