Detect music playing


I am using an android device in my car and I would restart the music playing when USB power is ON if on previous "power off" the music was playing.

To do this I think I have to detect when musing is playing and set a variable or write a variable to a file (If phone as been rebooted).
And when USB power is back read the variable or file and then do a If statement

But I can't find a way to detect music playing. I am using poweramp.


Well-Known Member
Make a profile that sets a variable %Whatever to 1 when you open poweramp, and an exit task to bring it back to 0.
Then for your other profiles, use State/Variable Value/%Whatever = 1 as a context.