android - Problem in playing video :( -


i have list view , want when row click play video, code :

public void onitemclick(adapterview<?> a, view v, int position, long id) { setcontentview(r.layout.video); videoview videoview = (videoview)findviewbyid(r.id.videoview); mediacontroller mc = new mediacontroller(?); videoview.setmediacontroller(mc);     videoview.setvideouri(uri.parse((string) mylist.getitematposition(position))); videoview.requestfocus();     videoview.start(); } 

please use putextra method in activity

protected void onlistitemclick(listview l, view v, int position, long id) {     super.onlistitemclick(l, v, position, id);     object o = this.getlistadapter().getitem(position);     string videouri= o.tostring();      intent in = new intent(getapplicationcontext(), videoexamplesactivity.class);        in.putextra(key_name, videouri);      startactivity(in);     toast.maketext(this, "you have chosen videouri: " + " " + videouri, toast.length_long).show(); } 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -