1

NOTE: I'm using either Java or C# (Xamarin.Forms), whichever is the easiest. I'd prefer Java, but if I could do the same in Xamarin.Forms that's fine as well.

I want to run code when a specified app is launched (Or in foreground but preferably launched).

E.g when app Facebook is launched Toast "Facebook" or "App launched". What do I want to do with this? When a specified app is launched, I want to turn down/up the volume on the device.

Thanks.

WoJo
  • 500
  • 1
  • 3
  • 20
  • Well in my knowledge this cannot be done in a direct way. What you can do is check the logcat BUT that only works pre-jelly bean. – FreakyAli Jan 12 '20 at 19:08
  • Hmm that would not be an option. Are you aware of any other options? I know other apps that can do it. – WoJo Jan 12 '20 at 19:09
  • Check this https://stackoverflow.com/questions/3290936/android-detect-when-other-apps-are-launched – FreakyAli Jan 13 '20 at 06:46
  • Apparently that only works for Jelly Bean and lower – WoJo Jan 14 '20 at 15:57

0 Answers0