Black screen when returning to video playback activity in Android

前端 未结 7 1314
星月不相逢
星月不相逢 2021-02-04 07:13

I\'m currently developing the android application ServeStream and I\'ve encountered and problem that I can\'t fix. My application will stream music and video using the android M

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-04 07:38

    Do you want the activity not to be shown when you return? if yes you can simply use flag

    i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    

    If you want your media to be played in background I suggest you to use video surface as it has been irritating me playing in background though I dont want. There are ways but I hope this one will be fruitful for you http://www.brightec.co.uk/blog/custom-android-media-controller

    this link actually is for customizing media controllers as you wish but as I created mine with it, I was bothered as pressing home key, the video would be played in background.

提交回复
热议问题