app start after 5 seconds when pressing home button

来源:互联网 发布:淘宝代理发货流程 编辑:程序博客网 时间:2024/05/16 07:01

Simply put, after pressing the HOME button, android prevents services and broadcast-receivers from calling startActivity for 5 seconds.

I've also noticed that (well, theoretically), having the following permission :

"android.permission.STOP_APP_SWITCHES"

allows you to call resumeAppSwitches (which is defined in ActivityManagerService).

So using resumeAppSwitchs , we can start activity before 5 seconds.



0 0
原创粉丝点击