When I install my app on certain devices (seems to be 4.4.4 and later) I sometimes see the following ANR in com.android.launcher after the following steps:
This is probably a bug in the Android Framework. I tested on about 12 devices today and noticed that this bug occurs reliably on Nexus-type devices running these versions of Android:
Interestingly, Samsung devices running the same versions of Android do not exhibit the problem. Android 5.1 and later seems to be better in that I see no more ANRs in com.android.launcher; however I am now seeing ANRs in com.google.android.googlequicksearchbox.
I worked around this problem after noticing that my Activity was overriding onBackPressed() without invoking super.onBackPressed(). After I added super.onBackPressed(), the ANRs went away. But this is not a full workaround because calling super.onBackPressed() finished my Activity, which I do not want.
I hope this helps someone.
See: Using FLAG_ACTIVITY_REORDER_TO_FRONT to switch among persistently running UI activities leads to "no window focus" error
See: Android-L issue: onBackpressed when using FLAG_ACTIVITY_REORDER_TO_FRONT to launch previous activity & freezes app for sometime
Also, I found a bug entry on Google's site that seems related: https://code.google.com/p/android/issues/detail?id=91534