简体   繁体   中英

Status bar notification

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?

您需要一次又一次地infinite loo播放声音,并maintain a bool值来开始和停止声音,就像当用户按下将其设为true并再次单击使其变为false并退出循环时一样。您可以使用sharedPreferences进行存储布尔值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM