我需要在按下主页键时执行一些动作,例如当有人按下主页时启动活动...怎么做?
If what you really want is to perform some actions when your activity leaves the foreground, see the activity lifecycle . Your activity will have its onPause
method called when it is no longer in the foreground, and onStop
called when it is no longer visible.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.