I have a problem in my application . My problem is that Main Class has a VideoView and when I went to other class and return the main class , I see a black screen instead of video .
How can I solve it ?
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
VideoView videoView = (VideoView) findViewById(R.id.videoid);
Uri adres = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.arkaplan);
videoView.setVideoURI(adres);
videoView.requestFocus();
videoView.start();
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mp.setLooping(true);
}
});