You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i use the isApplicationBroughtToBackground method (standalone, not the the whole doid-fu package) to implement a security feature that displays a locking screen if my app regains the focus after coming back from a different app.
now, the problem was that the security gesture sometimes showed twice. after digging around a bit i noticed that if the isApplicationBroughtToBackground method is called again directly after returning from the background (in my case because the launch of the security activity after coming back triggered the onPause method of the launching activity), the topActivity from ActivityManager.getRunningTasks(1) is sometimes still the activity you just returned from.
i suspect that maybe activities that do a lot of cleanup after being closed may linger on top of the RunningTasks stack for a short time, but if onPause is called again right after returning the short time might be enough to register as a second isApplicationBroughtToBackground, when this is not actually the case.
in my case, the offending lingering app was com.android.mms, but other apps triggered it too.
The text was updated successfully, but these errors were encountered:
i use the
isApplicationBroughtToBackground
method (standalone, not the the whole doid-fu package) to implement a security feature that displays a locking screen if my app regains the focus after coming back from a different app.now, the problem was that the security gesture sometimes showed twice. after digging around a bit i noticed that if the
isApplicationBroughtToBackground
method is called again directly after returning from the background (in my case because the launch of the security activity after coming back triggered the onPause method of the launching activity), the topActivity from ActivityManager.getRunningTasks(1) is sometimes still the activity you just returned from.i suspect that maybe activities that do a lot of cleanup after being closed may linger on top of the RunningTasks stack for a short time, but if onPause is called again right after returning the short time might be enough to register as a second isApplicationBroughtToBackground, when this is not actually the case.
in my case, the offending lingering app was
com.android.mms
, but other apps triggered it too.The text was updated successfully, but these errors were encountered: