Detect which app has been launched in android
问题 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 or background. hike messenger has achieved same functionality with accessibility service. How can I solve this problem ? Thanks in advance!! 回答1: Depending on the Android version running your application, you will have to use different methods. On Pre-Lollipop devices, it is pretty straight-forward: String[] result =