ad728

Saturday, February 20, 2021

AIDE Tutorial - 32 VideoView


Main xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
    <VideoView
        android:id="@+id/videoView"
        android:layout_width="match_parent"
      android:layout_height="match_parent"
       />
</LinearLayout>
Java
package com.mycompany.myapp5;
import android.app.*;
import android.os.*;
import android.widget.*;
import android.net.*;
import org.apache.http.client.protocol.*;
public class MainActivity extends Activity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
   

VideoView video=(VideoView)findViewById(R.id.videoView);
video.setVideoURI(Uri.parse("android.resource://"+ getPackageName() + "/" + R.raw.customlayout));
video.setMediaController(new MediaController(this));
video.requestFocus();



}
}
Share:

1 comment:

  1. Lucky 15 Casino - MapyRO
    The Lucky 용인 출장샵 15 Casino is located at the Casino, Off Highway 33A in New York City. 아산 출장안마 Check 광주 출장안마 availability now! See 경상북도 출장안마 the directions, paytable and more! 충청북도 출장샵

    ReplyDelete

Total Pageviews

Sponsor

Sponsor

ad300