How to play video in my player from gallery in android? -


i developing video player in want set player @ launcher, user can play video in player gallery that:

<intent-filter>     <action android:name="android.intent.action.view" />      <category android:name="android.intent.category.default" />     <category android:name="android.intent.category.browsable" />      <data android:mimetype="video/*" />     <data android:mimetype="application/sdp" />     <data android:pathpattern=".*3gp" />     <data android:pathpattern=".*3gp" />     <data android:pathpattern=".*mp4" />     <data android:pathpattern=".*mp4" /> </intent-filter>  

when set things in manifest show player @ video player launcher

my problem is how video path in activity play video

intent = getintent();    uri tmpselectedimageuri = i.getdata();  filename = getpath(tmpselectedimageuri, viewvideo.this);    public string getpath(uri uri, activity activity) {      string[] projection = { mediacolumns.data };         cursor cursor = activity.managedquery(uri, projection, null, null, null);         int column_index =  cursor.getcolumnindexorthrow(mediacolumns.data);     cursor.movetofirst();        return cursor.getstring(column_index);  } 

it work me.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -