当前位置:操作系统 > 安卓/Android >>

Android调用系统播放器

Java代码
package cn.com; 
 
import android.app.Activity; 
import android.content.Intent; 
import android.net.Uri; 
import android.os.Bundle;  www.zzzyk.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); 
         
    } 


摘自 sql_help的专栏
补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,