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.