How to play mp3 continuosly when application starts and stop when user close app in background

后端 未结 4 1764
一整个雨季
一整个雨季 2021-01-26 02:14

I am writing an app in which i am allowing user to view images and select one of them to set an WALLPAPER, and in this i also want to play an mp3 when user starts an App and sto

4条回答
  •  执笔经年
    2021-01-26 03:04

    simply put your player.start() method in onResume() method and call player.stop () in onPause() method.Take a look at this Difference between onStart() and onResume()

提交回复
热议问题