71.3 Entering Picture-in-Picture Mode
The enterPipMode onClick callback method now needs to be added to the MainActivity.java class file. Locate this file, open it in the code editor and add this method as follows:
.
.
import android.view.View;
import android.app.PictureInPictureParams;
import android.util.Rational;
import android.widget.Button;
.
.
public void enterPipMode(View view) {
Button pipButton = findViewById(R.id.pipButton);
Rational rational = new Rational(videoView.getWidth(),
videoView.getHeight());
PictureInPictureParams params =
new PictureInPictureParams.Builder()
...