This is my activity and it's working.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_playing);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Intent intent = getIntent();
String link = intent.getStringExtra("link");
VideoView videoview = (VideoView) findViewById(R.id.videoView2);
MediaController mediacontroller = new MediaController(this);
mediacontroller.setAnchorView(videoview);
Log.i("Link",link);
Uri video = Uri.parse(link);
videoview.setMediaController(mediacontroller);
videoview.requestFocus();
videoview.setVideoURI(video);
videoview.start();
}
This is the screen when playing:
But when the controller hides, the video screen is not fullscreen.
How can Videoview display fullscreen when mediacontroller hides?