Detect which app has been launched in android

后端 未结 3 1072
孤城傲影
孤城傲影 2021-01-21 21:54

How to detect which app has been launched by user in my app i.e my application should get notified when Whatsapp is launched by user even if my app is not running in foreground

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-21 22:09

    No, this is not really possible using the public SDK.

    You can get the current running process by ActivityManager#getRunningAppProcesses But it is definitely impossible to get notified .However, it isn't the most accurate, or efficient method

提交回复
热议问题