I want to implement a status bar notification and have some sound, and flashing alert to the user.
The sound plays very fine, but the problem is it stops just the user click on the status bar.
I want to continue playing the sound until the user does not want to stop it by clicking any button on it.
How can I do this?
You need to put play your sound again and again thru
infinite loop andmaintain a boolvalue to start and stop your sound as when user presses make it true and on another click make it false and exit the loop.You can usesharedPreferencesto store the bool value.