Hello all……

Someone has been asking me how to play a video in android in fullscreen. Then I made some surfing in the internet and found a solution.

You can check out how to play a video in android here and to check whether the video has completed playing here.
The only change was to do in the xml.

This is the xml code of the layout containing the videoview.

<?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
           android:layout_width="fill_parent"
           android:layout_height="fill_parent" >
   <VideoView android:id="@+id/myvideoview"
             android:layout_width="fill_parent"
             android:layout_alignParentRight="true"
             android:layout_alignParentLeft="true"
             android:layout_alignParentTop="true"
             android:layout_alignParentBottom="true"
             android:layout_height="fill_parent">
    </VideoView>
 </RelativeLayout>

Please leave your comments on this post.

You can download the complete source code here. Please include a video in res/raw folder and try.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

 

 

 

Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.