Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: getting back after playing video
    primarykey
    data
    text
    <p>I am working on an application where the user have a video list with play buttons on each row of listview. Whenever the user plays the play button, a separate activity is started for playing video. The problem I am having is that I have to press the back-button twice in order to return to the main Video. Moreover, I have set my video to landscape mode. When my original application is in portrait mode and the video is in landscape mode and then I return to my main application, it crashes. however, when my application or my device is in landscape mode and I play a video, then it is fine when I go back. So, I have two questions </p> <p>1- Why I have to press the back button twice to go back to the mainActivity (I have also used onBackPressed in the video activity to finish the current activity but its not working) 2- Why my application crashes when it is in the portrait mode and the video plays in the landscape mode and while returning to the main application, it changes the video to portrait mode as well for sometime and then crashes. Here is the code of my video playback (i don't know why I have to press back button twice to go back to the main application)</p> <pre><code>public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.videoview); Intent i = getIntent(); Bundle extras = i.getExtras(); filename = extras.getString("videofilename"); mVideoView = (VideoView)findViewById(R.id.videoview); path=filename; if (path == "") { Toast.makeText( ViewVideo.this, No video found, Toast.LENGTH_LONG).show(); } else { mVideoView.setVideoPath(path); mVideoView.setMediaController(new MediaController(this)); mVideoView.requestFocus(); mVideoView.start(); } } @Override public void onBackPressed() { Log.v(TAG,"movie finished"); finish(); }} </code></pre> <p>I hope my question was clear and someone will be able to help me</p> <p>THANKS </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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