日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Android >内容正文

Android

Android-- Intent.Action(2)

發布時間:2024/4/14 Android 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Android-- Intent.Action(2) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1 Intent.ACTION_VIEW

String android.intent.action.VIEW

用于顯示用戶的數據。比較通用,會根據用戶的數據類型打開相應的Activity。比如 tel:13400010001打開撥號程序,http://www.g.cn則會打開瀏覽器等。

代碼1:

Uri uri = Uri.parse("http://www.google.com"); //瀏覽器 //Uri uri =Uri.parse("tel:1232333"); //撥號程序 //Uri uri=Uri.parse("geo:39.899533,116.036476"); //打開地圖定位 Intent it = new Intent(Intent.ACTION_VIEW,uri); startActivity(it);

代碼2:

//調用發送短信的程序 Intent it = new Intent(Intent.ACTION_VIEW); it.putExtra("sms_body", "信息內容..."); it.setType("vnd.android-dir/mms-sms"); startActivity(it);

代碼3:

//播放視頻 Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.parse("file:///sdcard/media.mp4"); intent.setDataAndType(uri, "video/*"); startActivity(intent);


2 Intent.ACTION_SENDTO

String: android.intent.action.SENDTO

說明:發送短信息

//發送短信息 Uri uri = Uri.parse("smsto:13200100001"); Intent it = new Intent(Intent.ACTION_SENDTO, uri); it.putExtra("sms_body", "信息內容..."); startActivity(it);

//發送彩信,設備會提示選擇合適的程序發送 Uri uri = Uri.parse("content://media/external/images/media/23"); //設備中的資源(圖像或其他資源) Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra("sms_body", "內容"); intent.putExtra(Intent.EXTRA_STREAM, uri); intent.setType("image/png"); startActivity(it);

?

//Email Intent intent=new Intent(Intent.ACTION_SEND); String[] tos={"android1@163.com"}; String[] ccs={"you@yahoo.com"}; intent.putExtra(Intent.EXTRA_EMAIL, tos); intent.putExtra(Intent.EXTRA_CC, ccs); intent.putExtra(Intent.EXTRA_TEXT, "The email body text"); intent.putExtra(Intent.EXTRA_SUBJECT, "The email subject text"); intent.setType("message/rfc822"); startActivity(Intent.createChooser(intent, "Choose Email Client"));

轉載于:https://www.cnblogs.com/wservices/archive/2010/07/08/1773381.html

總結

以上是生活随笔為你收集整理的Android-- Intent.Action(2)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。