Note that there are some explanatory texts on larger screens.

plurals
  1. POVideoview not starting when the user comes back to activity
    text
    copied!<p>I'm starting a project and I want to reproduce a video in the main activity when the app is executed, when the user presses the video it goes to another activity. If the user press the back button, he is going to the main screen again and reproduces the video from the beginning. The video is located in the raw directory. </p> <p>The problem is that the videoview is reproducing the video when the activity is first created but not when the user goes back to it from the other activity (In my case the MenuSection activity). The code is really simple but i will paste it anyway:</p> <pre><code> public class MainActivity extends Activity { private VideoView mVideoView; LinearLayout menuSection; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); mVideoView = (VideoView) findViewById(R.id.surface_view); mVideoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() +"/"+R.raw.documentariesandyou)); mVideoView.requestFocus(); mVideoView.setMediaController(null); //i dont want the controls of the videoview. mVideoView.start(); menuSection = (LinearLayout) findViewById(R.id.menuSection); menuSection.setOnClickListener(new menuSectionListener()); } class menuSectionListener implements OnClickListener { public void onClick(View v) { Intent staticActivityIntent = new Intent(MainActivity.this, MenuSection.class); startActivity(staticActivityIntent); } } } </code></pre> <p>The MenuSection is just an activity that shows a textview like "Hello world", so I'm not pasting it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload