Intent呼叫常見系統元件

2021-08-21 09:56:48 字數 2234 閱讀 5434

// 呼叫瀏覽器

uri webviewuri =uri.parse("");

intent intent = newintent(intent.action_view, webviewuri);

// 呼叫地圖

uri mapuri =uri.parse("geo:100,100");

intent intent = newintent(intent.action_view, mapuri);

uri playuri =uri.parse("file:///sdcard/test.***");

intent intent = newintent(intent.action_view);

intent.setdataandtype(playuri,"audio/***");

// 呼叫撥打**

uri dialuri =uri.parse("tel:10086");

intent intent = newintent(intent.action_dial, dialuri);

// 直接撥打**,需要加上許可權

uri calluri =uri.parse("tel:10086");

intent intent = new intent(intent.action_call,calluri);

// 呼叫發郵件(這裡要事先配置好的系統email,否則是調不出發郵件介面的)

uri emailuri =uri.parse("mailto:[email protected]");

intent intent = newintent(intent.action_sendto, emailuri);

// 直接發郵件

intent intent = newintent(intent.action_send);

string tos = ;

string ccs = ;

intent.putextra(intent.extra_email, tos);

intent.putextra(intent.extra_cc, ccs);

intent.putextra(intent.extra_text,"the email text");

intent.putextra(intent.extra_subject,"subject");

intent.settype("text/plain");

intent.createchooser(intent, "chooseemail client");

// 跳轉到簡訊介面

intent intent = newintent(intent.action_view);

intent.putextra("sms_body","the sms text");

intent.settype("vnd.android-dir/mms-sms");

// 直接發簡訊

uri smstouri =uri.parse("smsto:10086");

intent intent = newintent(intent.action_sendto, smstouri);

intent.putextra("sms_body","the sms text");

// 發彩信

uri mmsuri =uri.parse("content://media/external/images/media/23");

intent intent = newintent(intent.action_send);

intent.putextra("sms_body","the sms text");

intent.putextra(intent.extra_stream,mmsuri);

intent.settype("image/png");

// 解除安裝應用

intent intent = new intent(intent.action_delete,uninstalluri);

// 安裝應用

intentintent = new intent(intent.action_view);

// 在android market中查詢應用

uri uri = uri.parse("market://search?q=憤怒的小鳥");

intent intent = newintent(intent.action_view, uri); 

android系統Intent呼叫應用

public class intentutils 瀏覽網頁 public static void openurl context context,string url 撥打 需要新增許可權 public static void tel context context,string telurl 呼叫...

Intent呼叫大全

呼叫瀏覽器 uri uri uri.parse intent it new intent intent.action view,uri startactivity it 顯示某個座標在地圖上 uri uri uri.parse geo 38.899533,77.036476 intent it ne...

Intent呼叫大全

呼叫瀏覽器 uri uri uri.parse intent it new intent intent.action view,uri startactivity it 顯示某個座標在地圖上 uri uri uri.parse geo 38.899533,77.036476 intent it ne...