android - VideoView Inside Navigation Drawer -
i trying put video view inside navigation drawer. videoview working fine freezing when navigation drawer move , videoview not moving navigation drawer. ideo fix this????? please :::
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <framelayout android:id="@+id/drop" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" > </framelayout> <relativelayout android:id="@+id/left_drawer" android:layout_width="280dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="#00000000" android:choicemode="singlechoice" android:dividerheight="1dp" android:paddingright="1dp" > <videoview android:id="@+id/videoview1" android:layout_width="280dp" android:layout_height="150dp" android:layout_centerhorizontal="true" /> </relativelayout>
here my activity::::
public class mainact extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.vid); videoview videoview= (videoview) contentview.findviewbyid(r.id.videoview1); videoview.setvideopath("/sdcard/x.mp4"); videoview.start(); } }
thanks in advance....
you can try set drawerlistener on navigation drawer , pause , resume videoview based on drawer state. should work:
mdrawerlayout.setdrawerlistener(new drawerlistener() { @override public void ondrawerstatechanged(int arg0) { // todo auto-generated method stub } @override public void ondrawerslide(view arg0, float arg1) { // todo auto-generated method stub } @override public void ondraweropened(view arg0) { // todo auto-generated method stub myvideoview.pause(); } @override public void ondrawerclosed(view arg0) { // todo auto-generated method stub myvideoview.resume(); } });
Comments
Post a Comment