Android Video View turns black
<p>This seems to be a very common problem, but I couldn't search for it on SO.</p>

<p>I have a simple <code>videoview</code> and it play video from a mp4 file. It continously plays video and loop through the video.</p>

<p>Problem is when playing I went to settings and came back then video turns black.</p>

<p><strong>This is my Code:</strong></p>

<pre><code>    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_video);
    video = (VideoView) findViewById(R.id.video);
    // Load and start the movie
    Uri video1 = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.videoplayback);
    video.setVideoURI(video1);
    video.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
        @Override
        public void onPrepared(MediaPlayer mp) {
            mp.setLooping(true);
        }
    });
    video.start();
</code></pre>

<p>I don't want anything special in this, just a full screen of video playback which loops video till user tap back button.</p>