How to detect when the user launches another app? (Android)

Yes, You can find the which application is launched, by Tracking the Logcat. Just Track on ActivityManager tag with info -I log.

From adb shell Command is,

adb logcat ActivityManager:I *:S

From your application code,

logcat ActivityManager:I *:S

And in Logcat you can find a line something like,

I/ActivityManager(  585): Starting activity: Intent { action=android.intent.action...}

When any application will launched.

It is logcat output that shows that the message relates to priority level “I” and tag “ActivityManager”:

Update:

Just add permission in your Application’s manifest file,

android.permission.READ_LOGS

Leave a Comment