灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:2596回复:0

Android调用系统播放器

楼主#
更多 发布于:2012-09-06 13:42

java代码
package cn.com;

import Android.app.Activity;
import Android.content.Intent;
import Android.net.Uri;
import Android.os.Bundle;  www.atcpu.com

public class Video extends Activity {
    
    Stringpath = "file:///sdcard/tmp60115.mp4";
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Intent it = new Intent(Intent.ACTION_VIEW);
        Uri uri = Uri.parse(path);
        it.setDataAndType(uri , "video/mp4");
        startActivity(it);
        
    }
}


喜欢0 评分0
游客

返回顶部