Android intent to video player to play video in res/raw file -


i new in android , have problem playing video using stack android video player. search answer everywhere don't find it.

my code is:

uri uri = uri.parse("android.resource://" + getpackagename() + "/" + r.raw.lp); intent intent = new intent(android.content.intent.action_view); intent.setpackage(getpackagename()); intent.setdataandtype(uri, "video/*"); startactivity(intent); 

it doesn't work , application crash. wrong. depend smartphone model? smartphone model thl 5000, android 4.4.2.

thanks!

try initialize this. worked me

uri.parse("android.resource://" + getpackagename() + "/raw/file_name"); 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -