intent的幾種常用用法_第1頁
intent的幾種常用用法_第2頁
intent的幾種常用用法_第3頁
intent的幾種常用用法_第4頁
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、.Intent的幾種用法 · 博客分類:· AndroidAndroidGoogleF#下面列出幾種Intent的用法顯示網(wǎng)頁:1 Uri uri = Uri.parse" :/ google "2 Intent it = new IntentIntent.ACTION_VIEW,uri;3 startActivityit;顯示地圖:4 Uri uri = Uri.parse"geo:38.899533,-77.036476"5 Intent it = new IntentIntent.Action_VIEW,uri;6 startA

2、ctivityit;途徑規(guī)劃:7 Uri uri = Uri.parse" :/maps.google /maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en"8 Intent it = new IntentIntent.ACTION_VIEW,URI;9 startActivityit;撥打 :調(diào)用撥號(hào)程序10 Uri uri = Uri.parse"tel:xxxxxx"11 Intent it = new IntentIntent.ACTION_DIAL

3、, uri; 12 startActivityit; 13 Uri uri = Uri.parse"tel.xxxxxx"14 Intent it =new IntentIntent.ACTION_CALL,uri;15 要使用這個(gè)必須在配置文件中參加<uses-permission id="android .permission.CALL_PHONE" />發(fā)送SMS/MMS調(diào)用發(fā)送短信的程序16 Intent it = new IntentIntent.ACTION_VIEW; 17 it.putExtra"sms_body&q

4、uot;, "The SMS text" 18 it.setType"vnd.android-dir/mms-sms" 19 startActivityit; 發(fā)送短信20 Uri uri = Uri.parse"smsto:0800000123" 21 Intent it = new IntentIntent.ACTION_SENDTO, uri; 22 it.putExtra"sms_body", "The SMS text" 23 startActivityit; 發(fā)送彩信24 Uri u

5、ri = Uri.parse"content:/media/external/images/media/23" 25 Intent it = new IntentIntent.ACTION_SEND; 26 it.putExtra"sms_body", "some text" 27 it.putExtraIntent.EXTRA_STREAM, uri; 28 it.setType"image/png" 29 startActivityit;發(fā)送Email3031 Uri uri = Uri.parse"

6、mailto:xxxabc "32 Intent it = new IntentIntent.ACTION_SENDTO, uri;33 startActivityit;34 Intent it = new IntentIntent.ACTION_SEND; 35 it.putExtraIntent.EXTRA_EMAIL, "meabc " 36 it.putExtraIntent.EXTRA_TEXT, "The email body text" 37 it.setType"text/plain" 38 startAct

7、ivityIntent.createChooserit, "Choose Email Client" 39 Intent it=new IntentIntent.ACTION_SEND; 40 String tos="meabc " 41 String ccs="youabc " 42 it.putExtraIntent.EXTRA_EMAIL, tos; 43 it.putExtraIntent.EXTRA_CC, ccs; 44 it.putExtraIntent.EXTRA_TEXT, "The email body

8、text" 45 it.putExtraIntent.EXTRA_SUBJECT, "The email subject text" 46 it.setType"message/rfc822" 47 startActivityIntent.createChooserit, "Choose Email Client" 添加附件48 Intent it = new IntentIntent.ACTION_SEND; 49 it.putExtraIntent.EXTRA_SUBJECT, "The email subje

9、ct text" 50 it.putExtraIntent.EXTRA_STREAM, "file:/sdcard/mysong.mp3" 51 sendIntent.setType"audio/mp3" 52 startActivityIntent.createChooserit, "Choose Email Client"53 /發(fā)送附件54 Intent it = new IntentIntent.ACTION_SEND; 55 it.putExtraIntent.EXTRA_SUBJECT, "The em

10、ail subject text" 56 it.putExtraIntent.EXTRA_STREAM, "file:/sdcard/eoe.mp3" 57 sendIntent.setType"audio/mp3" 58 startActivityIntent.createChooserit, "Choose Email Client"播放多媒體59 60 Intent it = new IntentIntent.ACTION_VIEW;61 Uri uri = Uri.parse"file:/sdcard/so

11、ng.mp3"62 it.setDataAndTypeuri, "audio/mp3"63 startActivityit;64 Uri uri = Uri.withAppendedPathMediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1" 65 Intent it = new IntentIntent.ACTION_VIEW, uri; 66 startActivityit; Uninstall 程序67 Uri uri = Uri.fromParts"package", st

12、rPackageName, null; 68 Intent it = new IntentIntent.ACTION_DELETE, uri; 69 startActivityit;uninstall apk70 Uri uninstallUri = Uri.fromParts"package", "xxx", null;7172 returnIt = new IntentIntent.ACTION_DELETE, uninstallUri;install apk73 Intent intent = new IntentIntent.ACTION_VIE

13、W; 74 intent.setDataAndTypeUri.parse"file:/sdcard/test.apk", "application/vnd.android.package-archive" 75 76 startActivityintent; play audio77 Uri playUri = Uri.parse"file:/sdcard/download/everything.mp3"7879 returnIt = new IntentIntent.ACTION_VIEW, playUri; 80 /搜索應(yīng)用81 Uri uri = Uri.parse"market:/search?q=pname:pkg_name" 82 Intent it = new IntentIntent.ACTION_VIEW, uri; 83 startActivityit; 84 /where pkg_name is the full package path for an application 8586 /顯示指定應(yīng)用的詳細(xì)頁面這個(gè)好似不支持了,找不到app_id87 Uri uri = Uri.parse"market:/details?id=app_id" 88

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論