//顯示網頁
//顯示地圖
uri uri = uri.parse("geo:38.899533,-77.036476");
intent it = new intent(intent.action_view, uri);
startactivity(it);
//其他 geo uri 範例
//geo:latitude,longitude
//geo:latitude,longitude?z=zoom
//geo:0,0?q=my+street+address
//geo:0,0?q=business+near+city
//google.streetview:cbll=lat,lng&cbp=1,yaw,,pitch,zoom&mz=mapzoom
//路徑規劃
//打**
//叫出撥號程式
uri uri = uri.parse("tel:0800000123");
intent it = new intent(intent.action_dial, uri);
startactivity(it);
//直接打**出去
uri uri = uri.parse("tel:0800000123");
intent it = new intent(intent.action_call, uri);
startactivity(it);
//用這個,要在 androidmanifest.xml 中,加上
////傳送sms/mms
//呼叫簡訊程式
intent it = new intent(intent.action_view, uri);
it.putextra("sms_body", "the sms text");
it.settype("vnd.android-dir/mms-sms");
startactivity(it);
//傳送訊息
uri uri = uri.parse("smsto://0800000123");
intent it = new intent(intent.action_sendto, uri);
it.putextra("sms_body", "the sms text");
startactivity(it);
//傳送 mms
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);
//傳送 email
uri uri = uri.parse("mailto:***@abc.com");
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_send);
it.putextra(intent.extra_subject, "the email subject text");
it.putextra(intent.extra_stream, "file:///sdcard/mysong.***");
sendintent.settype("audio/***");
startactivity(intent.createchooser(it, "choose email client"));
uri uri = uri.parse("file:///sdcard/song.***");
intent it = new intent(intent.action_view, uri);
it.settype("audio/***");
startactivity(it);
intent it = new intent(intent.action_view, uri);
startactivity(it);
//market 相關
//尋找某個應用
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);
//page, and notice the id from the address bar
//uninstall 應用程式
uri uri = uri.fromparts("package", strpackagename, null);
intent it = new intent(intent.action_delete, uri);
startactivity(it);
注:以上可以進行自行驗證,筆者正在驗證中。。。
Intent用法 持續
0.intent 基礎知識 1.intent用法 1.1 用法1 從庫中得到,以uri形式返回 最終可以轉變成流,以流得到bitmap private static final int image get 1 intent intent new intent intent.action pick,a...
Intent用法例項
intent用法很靈活,以下列出了intent的一些常用例項,主要包括activity的跳轉及啟動 intent intent new intent activity.main.this,activity2.class startactivity intent intent intent new i...
Intent用法例項
intent用法很靈活,以下列出了intent的一些常用例項,主要包括activity的跳轉及啟動 對於資料的獲取可以採用 注 setresult int resultcode,intent data 中的引數resultcode的作用是 在上乙個activity的onactivityresult函...