app start after 5 seconds when pressing home button

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.



你可能感兴趣的:(app start after 5 seconds when pressing home button)