Intent呼叫大全

2021-05-27 18:10:51 字數 3743 閱讀 3384

//呼叫瀏覽器

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);

//解除安裝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 intent = new intent();

intent.setaction(intent.action_web_search);

intent.putextra(searchmanager.query,"android123")

startactivity(intent);

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 呼叫事例

聯絡人呼叫 插入聯絡人介面 for api 4 intent intent new intent intent.setaction intent.action insert intent.setdata contacts.people.content uri startactivity intent...

android系統Intent呼叫應用

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