隨筆 - 0, 文章 - 264, 評論 - 170, 引用 - 0
          數據加載中……

          Android調用系統播放器(注:轉載于http://blog.csdn.net/sql_help/archive/2010/09/28/5912856.aspx)

             1package cn.com;  
             
          2.   
             
          3import android.app.Activity;  
             
          4import android.content.Intent;  
             
          5import android.net.Uri;  
             
          6import android.os.Bundle;  
             
          7.   
             
          8public class Video extends Activity {  
             
          9.       
            
          10.     String path = "file:///sdcard/tmp60115.mp4";  
            
          11.       
            
          12.     /** Called when the activity is first created. */  
            
          13.     @Override  
            
          14.     public void onCreate(Bundle savedInstanceState) {  
            
          15.         super.onCreate(savedInstanceState);  
            
          16.         setContentView(R.layout.main);  
            
          17.           
            
          18.         Intent it = new Intent(Intent.ACTION_VIEW);  
            
          19.         Uri uri = Uri.parse(path);  
            
          20.         it.setDataAndType(uri , "video/mp4");  
            
          21.         startActivity(it);  
            
          22.           
            
          23.     }  
            
          24. } 

          posted on 2010-11-21 13:57 小一敗涂地 閱讀(2885) 評論(0)  編輯  收藏 所屬分類: android+移動開發

          主站蜘蛛池模板: 诸暨市| 青铜峡市| 安宁市| 汉川市| 平乐县| 家居| 固始县| 扶沟县| 施甸县| 凤庆县| 敦煌市| 屯昌县| 永昌县| 顺昌县| 汶上县| 洱源县| 阿勒泰市| 永靖县| 古丈县| 阿鲁科尔沁旗| 习水县| 宁远县| 乌拉特中旗| 深圳市| 通化县| 天峻县| 封丘县| 健康| 明光市| 甘孜县| 启东市| 荆门市| 孟连| 仙居县| 枣阳市| 城口县| 遵义市| 九龙坡区| 荃湾区| 清水县| 左贡县|