Reason for 5 sec delay to show an activity on pressing the home button?
Asked Answered
C

1

3

I am facing delay of 5 sec to show an Activity after pressing the HOME key. I had gone through some post and found that after pressing the HOME button, android prevents services and broadcast-receivers from calling startActivity for 5 seconds.

Q1. Can anyone please let me know the reason to happening this delay ?

Q2. When I modified the ActivityManagerService::checkAppSwitchAllowedLocked() to always return true, it avoids checking lock and hence Activity gets shown without any delay. Would it be a good solution to avoid delay or it may cause any wrong effect in other ways ?

Cumbrous answered 17/11, 2011 at 7:17 Comment(2)
I have used the permission in AndroidManifest.xml of my app as: <uses-permission android:name="android.permission.STOP_APP_SWITCHES"/> but still its getting delayed by 5 secs.Cumbrous
Have you found the solution for this?Sitra
C
3

I know, it's probably too late (half year passed). However, here is the answer

Colossal answered 27/3, 2012 at 22:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.