国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Android > 正文

Android 啟動第三方程序的方法總結

2019-10-23 18:31:21
字體:
來源:轉載
供稿:網友

Android 啟動第三方程序的方法總結

方法一:

Intent intent = new Intent(); intent.setClassName(<package name>, <class name>); startActivity(intent);

方法二:

Intent i=new Intent;ComponentName com= new ComponentName(<Package Name> , <Calss Name>); i.setComponent(com); startActivity(i); 

啟動媒體庫

Intent i = new Intent();ComponentName comp = new ComponentName("com.Android.camera","com.android.camera.GalleryPicker");i.setComponent(comp);i.setAction("android.intent.action.VIEW");startActivity(i);

啟動相機

Intent mIntent = new Intent();ComponentName comp = new ComponentName("com.android.camera","com.android.camera.Camera");mIntent.setComponent(comp);mIntent.setAction("android.intent.action.VIEW");startActivity(mIntent);

啟動htmlviewer,并打開指定的一個文件 注意TXT不能是ANSI的,否則會亂碼

Intent intent = new Intent();ComponentName cn = new ComponentName("com.android.htmlviewer", "com.android.htmlviewer.HTMLViewerActivity");intent.setComponent(cn);Uri uri = Uri.fromFile(new File("/sdcard/demo.txt"));intent.setDataAndType(uri, "text/plain");startActivity(intent);

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!


注:相關教程知識閱讀請移步到Android開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 苗栗市| 乌拉特前旗| 虎林市| 江都市| 交城县| 得荣县| 日照市| 格尔木市| 建阳市| 资阳市| 察雅县| 南溪县| 普格县| 抚顺市| 平南县| 曲松县| 隆安县| 沁源县| 嘉峪关市| 当阳市| 洛宁县| 浑源县| 台山市| 广灵县| 怀柔区| 富阳市| 柯坪县| 高州市| 洪江市| 宜宾县| 石景山区| 华坪县| 沅江市| 彰武县| 库车县| 灵川县| 灵宝市| 开封县| 上栗县| 内江市| 固镇县|