//呼叫瀏覽器
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 = new intent(intent.action_view,uri);
startactivity(it);
//顯示路徑
uri uri = uri.parse("");
intent it = new intent(intent.action_view,uri);
startactivity(it);
//撥打**
uri uri = uri.parse("tel:10086");
intent it = new intent(intent.action_dial, uri);
startactivity(it);
uri uri = uri.parse("tel.10086");
intent it =new intent(intent.action_call,uri);
需要新增 這個許可權到androidmanifest.xml
//傳送簡訊或彩信
intent it = new intent(intent.action_view);
it.putextra("sms_body", "the sms text");
it.settype("vnd.android-dir/mms-sms");
startactivity(it);
//傳送簡訊
uri uri = uri.parse("smsto:10086");
intent it = new intent(intent.action_sendto, uri);
it.putextra("sms_body", "cwj");
startactivity(it);
//傳送彩信
uri uri = uri.parse("content://media/external/images/media/23");
intent it = new intent(intent.action_send);
it.putextra("sms_body", "some text");
it.putextra(intent.extra_stream, uri);
it.settype("image/png");
startactivity(it);
//傳送郵件
uri uri = uri.parse("mailto:[email protected]");
intent it = new intent(intent.action_sendto, uri);
startactivity(it);
intent it = new intent(intent.action_send);
it.putextra(intent.extra_email, [email protected]);
it.putextra(intent.extra_text, "the email body text");
it.settype("text/plain");
startactivity(intent.createchooser(it, "choose email client"));
intent it=new intent(intent.action_send);
string tos=;
string ccs=;
it.putextra(intent.extra_email, tos);
it.putextra(intent.extra_cc, ccs);
it.putextra(intent.extra_text, "the email body text");
it.putextra(intent.extra_subject, "the email subject text");
it.settype("message/rfc822");
startactivity(intent.createchooser(it, "choose email client"));
intent it = new intent(intent.action_view);
uri uri = uri.parse("file:///sdcard/cwj.***");
it.setdataandtype(uri, "audio/***");
startactivity(it);
intent it = new intent(intent.action_view, uri);
startactivity(it);
//解除安裝apk
uri uri = uri.fromparts("package", strpackagename, null);
intent it = new intent(intent.action_delete, uri);
startactivity(it);
//解除安裝apk 2
uri uninstalluri = uri.fromparts("package", "***", null);
returnit = new intent(intent.action_delete, uninstalluri);
//安裝apk
uri installuri = uri.fromparts("package", "***", null);
returnit = new intent(intent.action_package_added, installuri);
uri playuri = uri.parse("file:///sdcard/download/sth.***");
returnit = new intent(intent.action_view, playuri);
//傳送附近
intent it = new intent(intent.action_send);
it.putextra(intent.extra_subject, "the email subject text");
it.putextra(intent.extra_stream, "file:///sdcard/cwj.***");
sendintent.settype("audio/***");
startactivity(intent.createchooser(it, "choose email client"));
//market上某個應用信,pkg_name就是應用的packagename
uri uri = uri.parse("market://search?q=pname:pkg_name");
intent it = new intent(intent.action_view, uri);
startactivity(it);
intent it = new intent(intent.action_view, uri);
startactivity(it);
//呼叫搜尋
intent intent = new intent();
intent.setaction(intent.action_web_search);
intent.putextra(searchmanager.query,"android123")
startactivity(intent);
android intent 用法總結
給移動客服10086撥打 uri uri uri.parse tel 10086 intent intent new intent intent.action dial,uri startactivity intent 給10086傳送內容為 hello 的簡訊 uri uri uri.parse ...
Android Intent學習總結
intent物件大致包含component action category data type extra和flag這7種屬性,其中component用於明確指定需要啟動的目標元件,而extra則用於 攜帶 需要交換的資料。顯式啟動 啟動指定元件 以找男朋友為例,顯示啟動指定物件,比如一定要 梁山伯...
Android Intent全面用法
前言 前幾天在做跳轉到系統應用通知頁的時候,用到了intent的多種用法,故現在來總結一下。1.intent簡介 intent可以啟動activity,service或者配合廣播使用。在sdk中給出了intent作用的表現形式為 通過 context.startactivity 或者 activit...