My app shows video streaming using exoplayer. All works ok until i use/activate Pip. After i put any video in Pip and go back to prev activity from backstack ( automatically ) when i press any button i get :
WindowManager: android.view.WindowLeaked: Activity com.rcsrds.player.ui.main.MainActivity has leaked window DecorView@ff7d496[] that was originally added here
i get this error message on some of my test phone, not all. If i press more than 1 time any button after 5 sec i get ANR (sometimes) ; My app does not use any dialog
I do have a ProgressBar. Comment it and error still appears.
LE : my player is a customview. This should be a problem for PiP ?
to enter in Pip i use
public void enterPictureInPicture(PictureInPictureParams nPipParams) {
ActivityUtils.hideSystemUI(this.getWindow());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
enterPictureInPictureMode(nPipParams);
} else {
//Toast.makeText(this,"Picture in Picture not availabe",Toast.LENGTH_LONG).show();
}
}
<activity
android:name=".ui.main.MainActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout"
android:supportsPictureInPicture="true"
android:excludeFromRecents="true"
android:autoRemoveFromRecents="true"
/>