日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國(guó)內(nèi)最全I(xiàn)T社區(qū)平臺(tái) 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當(dāng)前位置:首頁(yè) > 互聯(lián)網(wǎng) > android 常見(jiàn) action 使用

android 常見(jiàn) action 使用

來(lái)源:程序員人生   發(fā)布時(shí)間:2014-11-03 08:13:34 閱讀次數(shù):2825次

本文介紹Android中Intent的各種常見(jiàn)作用。

 

1 Intent.ACTION_MAIN

String: android.intent.action.MAIN

標(biāo)識(shí)Activity為1個(gè)程序的開(kāi)始。比較經(jīng)常使用。

Input:nothing

Output:nothing 

 

<activity android:name=".Main" android:label="@string/app_name">   
<intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.LAUNCHER" />
     </intent-filter>
</activity> 

 

2 Intent.Action_CALL

Stirng: android.intent.action.CALL

呼喚指定的電話號(hào)碼。

Input:電話號(hào)碼。數(shù)據(jù)格式為:tel:+phone number 

Output:Nothing 

 

Intent intent=new Intent(); 

intent.setAction(Intent.ACTION_CALL);   
intent.setData(Uri.parse("tel:1320010001");
startActivity(intent);

 

3 Intent.Action.DIAL

String: action.intent.action.DIAL

調(diào)用撥號(hào)面板


Intent intent=new Intent();
intent.setAction(Intent.ACTION_DIAL);   //android.intent.action.DIAL
intent.setData(Uri.parse("tel:1320010001");
startActivity(intent); 


Input:電話號(hào)碼。數(shù)據(jù)格式為:tel:+phone number 

Output:Nothing

說(shuō)明:打開(kāi)Android的撥號(hào)UI。如果沒(méi)有設(shè)置數(shù)據(jù),則打開(kāi)1個(gè)空的UI,如果設(shè)置數(shù)據(jù),action.DIAL則通過(guò)調(diào)用getData()獲得電話號(hào)碼。

但設(shè)置電話號(hào)碼的數(shù)據(jù)格式為 tel:+phone number. 

 

4 Intent.Action.ALL_APPS

String: andriod.intent.action.ALL_APPS

列出所有的利用。

Input:Nothing.

Output:Nothing.

 

5 Intent.ACTION_ANSWER

Stirng:android.intent.action.ANSWER

處理呼入的電話。

Input:Nothing.

Output:Nothing.

 

6 Intent.ACTION_ATTACH_DATA

String: android.action.ATTCH_DATA

別用于指定1些數(shù)據(jù)應(yīng)當(dāng)附屬于1些其他的地方,例如,圖片數(shù)據(jù)應(yīng)當(dāng)附屬于聯(lián)系人

Input: Data

Output:nothing

 

7 Intent.ACTION_BUG_REPORT

String: android.intent.action.BUG_REPORT

顯示Dug報(bào)告。

Input:nothing

output:nothing

 

8 Intent.Action_CALL_BUTTON

String: android.action.intent.CALL_BUTTON.

相當(dāng)于用戶(hù)按下“撥號(hào)”鍵。經(jīng)測(cè)試顯示的是“通話記錄”

Input:nothing

Output:nothing

 

Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
startActivity(intent);

 

9 Intent.ACTION_CHOOSER

String: android.intent.action.CHOOSER

顯示1個(gè)activity選擇器,允許用戶(hù)在進(jìn)程之前選擇他們想要的,與之對(duì)應(yīng)的是Intent.ACTION_GET_CONTENT.

 

10. Intent.ACTION_GET_CONTENT

String: android.intent.action.GET_CONTENT

允許用戶(hù)選擇特殊種類(lèi)的數(shù)據(jù),并返回(特殊種類(lèi)的數(shù)據(jù):照1張相片或錄1段音) 

Input: Type

Output:URI

 

int requestCode = 1001;
Intent intent = new Intent(Intent.ACTION_GET_CONTENT); // "android.intent.action.GET_CONTENT"
intent.setType("image/*"); // 查看類(lèi)型,如果是其他類(lèi)型,比如視頻則替換成 video/*,或 */*
Intent wrapperIntent = Intent.createChooser(intent, null);

startActivityForResult(wrapperIntent, requestCode);  


11 Intent.ACTION_VIEW

String android.intent.action.VIEW

用于顯示用戶(hù)的數(shù)據(jù)。

比較通用,會(huì)根據(jù)用戶(hù)的數(shù)據(jù)類(lèi)型打開(kāi)相應(yīng)的Activity。

比如 tel:13400010001打開(kāi)撥號(hào)程序,http://www.g.cn則會(huì)打開(kāi)閱讀器等。

 

Uri uri = Uri.parse("http://www.google.com"); //閱讀器 
Uri uri =Uri.parse("tel:1232333"); //撥號(hào)程序 
Uri uri=Uri.parse("geo:39.899533,116.036476"); //打開(kāi)地圖定位 
Intent it = new Intent(Intent.ACTION_VIEW,uri); 
startActivity(it); 

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

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

 

12 Intent.ACTION_SENDTO 

String: android.intent.action.SENDTO 
說(shuō)明:發(fā)送短信息

 

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

 

復(fù)制代碼
//發(fā)送彩信,裝備會(huì)提示選擇適合的程序發(fā)送 
Uri uri = Uri.parse("content://media/external/images/media/23"); 
//裝備中的資源(圖象或其他資源) 
Intent intent = new Intent(Intent.ACTION_SEND); 
intent.putExtra("sms_body", "內(nèi)容"); 
intent.putExtra(Intent.EXTRA_STREAM, uri); 
intent.setType("image/png"); 
startActivity(it);
復(fù)制代碼


復(fù)制代碼
 //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"));
生活不易,碼農(nóng)辛苦
如果您覺(jué)得本網(wǎng)站對(duì)您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈(zèng)
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 亚洲欧美日韩高清 | 天堂аⅴ在线最新版在线 | 激情在线视频 | 黄色三级免费看 | 麻豆视频观看 | 欧美日韩激情在线 | 黄色在线观看视频网站 | 福利片网站 | 久久久久网站 | 成人精品 | 久久成人国产 | 综合久久一区二区三区 | 久久福利精品 | 五月天久久久 | 永久精品 | 99精品视频在线观看免费播放 | 国产一区二区三区四区五区美女 | 久久久久国产精品免费免费搜索 | 久久毛片 | 亚洲日韩中文字幕一区 | 国产精品成人一区二区三区吃奶 | 精品久久久久一区二区 | 久久久精品亚洲 | 国产精品久久久久久久第一福利 | 国产日韩精品视频 | 国产精品一区二区三区久久 | 国产精品免费久久 | 国产69精品久久久久777 | 91精品国产综合久久蜜臀 | 国产性av | 麻豆视频在线观看免费网站黄 | 国产精品永久免费视频 | 夜夜骑狠狠干 | 99精品一区二区三区 | 99久久久久| 国产99精品| 日韩久久高清 | 中文字幕 亚洲视频 | 日韩中文字幕久久 | 美女久久久久久久 | 国产99久久久久久免费看农村 |