3

I'm working on an android application that plays video, by using an intent:

tostart = new Intent(Intent.ACTION_VIEW);
tostart.setDataAndType(Uri.parse(movieurl), "video/*");
startActivity(tostart); 

This works great. However, when you press the back button (on the device), the movieplayer goes back to the beginning of the movie. Only when you press back again, it goes back to my application. While the current behaviour makes some sense, I would like to know if I can change it: Is is possible to directly go back after pressing back? Thanks! PanMan.

PanMan
  • 1,305
  • 1
  • 10
  • 16
  • Have you tried handling KeyEvent.KEYCODE_BACK – bhatt4982 Sep 23 '09 at 16:46
  • I don't think you can handle keyevent's while in other apps (the intent basically fires another app). But it's possible I'm wrong (I hope so!). Any idea's on that? – PanMan Oct 07 '09 at 11:48

1 Answers1

1

given that you cannot handle another application's key event, your other option is to find (or build) some third party application that plays video.

yanokwa
  • 1,408
  • 1
  • 12
  • 23