Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android video intent: Control back button?

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.

like image 620
PanMan Avatar asked Feb 26 '26 15:02

PanMan


1 Answers

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.

like image 126
yanokwa Avatar answered Mar 01 '26 08:03

yanokwa