隨筆 - 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 小一敗涂地 閱讀(2884) 評論(0)  編輯  收藏 所屬分類: android+移動開發

          主站蜘蛛池模板: 竹北市| 武城县| 青龙| 登封市| 绥棱县| 台湾省| 河西区| 新乡市| 东丽区| 新建县| 唐海县| 金乡县| 阿克陶县| 新安县| 吉木萨尔县| 台安县| 沿河| 集贤县| 如东县| 平远县| 旬邑县| 县级市| 社会| 云龙县| 万盛区| 桂阳县| 六安市| 铁岭县| 尚志市| 托克逊县| 楚雄市| 九龙县| 西丰县| 仁寿县| 曲沃县| 抚松县| 浠水县| 彰化县| 辽阳市| 六安市| 石门县|