android格式布局和videoview
来源:互联网 发布:2017淘宝刷不了单 编辑:程序博客网 时间:2024/05/19 14:18
res/layout<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.administrator.hello.MainActivity" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" > <VideoView android:id="@+id/videoView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="vertical" > </LinearLayout></LinearLayout>java/MainActivitypackage com.example.administrator.hello;import android.app.Activity;import android.net.Uri;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.MediaController;import android.widget.VideoView;/** * Created by Administrator on 2017/7/27. */public class MainActivity extends Activity { private Button button_start=null; private Button button_pause=null; private Button button_stop=null; private VideoView videoView=null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Uri uri =Uri.parse("android.resource://"+this.getPackageName()+"/" + R.raw.cc_01); VideoView videoView = (VideoView)this.findViewById(R.id.videoView); videoView.setMediaController(new MediaController(this)); videoView.setVideoURI(uri); videoView.start(); videoView.requestFocus(); }}
阅读全文
0 0
- android格式布局和videoview
- Android的videoView和mediaController
- android之VideoView和SurfaceView
- 布局与控件(六)-TableLayout和VideoView
- Android-- VideoView
- android videoview
- android视频播放(VideoView和MediaController)
- Android VideoView状态跟踪和错误处理
- android MediaPlayer和VideoView的使用
- Android MediaPlayer和VideoView的使用
- android 修改videoview的宽度和高度
- Android MediaPlayer和VideoView的使用
- android之视频播放系统VideoView和自定义VideoView控件的应用
- Android的多种布局格式
- android之VideoView和视频播放View的扩展
- android之VideoView和视频播放View的扩展
- android之VideoView和视频播放View的扩展
- android之VideoView和视频播放View的扩展
- CentOS 7设置静态IP
- centos7 安装teamviewer
- OpenCV3.0+VS2013+Windows7开发环境搭建
- windows C++ 遍历目录,获取文件名和文件路径
- supervisord监控服务常用技巧
- android格式布局和videoview
- C语言32个关键字
- python中的深拷贝和浅拷贝
- 矫正牙齿没那么容易,但是年龄也不是限制因素
- Subsequence --二分法
- 水果 HDU
- vmware11配置vmware-tools实现windows文件与vm文件共享
- 中国象棋的跳马问题(BFS)
- css滤镜技术