国产乱人视频免费观看网站,九九精品视频在线观看,九九久re8在线精品视频,日韩久久精品五月综合

<menu id="zjelp"></menu>

    <th id="zjelp"><tbody id="zjelp"><form id="zjelp"></form></tbody></th>
    <small id="zjelp"><menuitem id="zjelp"></menuitem></small>
  • <small id="zjelp"></small>

    <address id="zjelp"></address>
    <address id="zjelp"></address>
    v客學(xué)院——安卓意圖詳解

    v客學(xué)院——安卓意圖詳解

    ID:34726913

    大?。?01.68 KB

    頁(yè)數(shù):7頁(yè)

    時(shí)間:2019-03-10

    v客學(xué)院——安卓意圖詳解_第1頁(yè)
    v客學(xué)院——安卓意圖詳解_第2頁(yè)
    v客學(xué)院——安卓意圖詳解_第3頁(yè)
    v客學(xué)院——安卓意圖詳解_第4頁(yè)
    v客學(xué)院——安卓意圖詳解_第5頁(yè)
    資源描述:

    《v客學(xué)院——安卓意圖詳解》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)

    1、安卓意圖詳解1.Intent作用Intent是一個(gè)將要執(zhí)行的動(dòng)作的抽象的描述,由Intent來(lái)協(xié)助完成android各個(gè)組件之間的通訊。比如調(diào)用Activity實(shí)例化對(duì)象的startActivity()來(lái)啟動(dòng)一個(gè)activity,或者由broadcaseIntent()來(lái)傳遞給所有感興趣的BroadcaseReceiver,或者由startService()/bindservice()來(lái)啟動(dòng)一個(gè)后臺(tái)的service??梢?,intent主要用來(lái)啟動(dòng)activity或者service(并攜帶需要傳遞的參數(shù)信息),intent理解成activi

    2、ty之間的粘合劑。總之,Intent具有激活組件和攜帶數(shù)據(jù)的功能!2.Intent形式(1).顯示意圖(ExplicitIntents)明確指定組件名的Intent為顯式意圖,指定了Intent應(yīng)該傳遞給那個(gè)組件。通過下面代碼方式,可以創(chuàng)建顯示意圖實(shí)例化對(duì)象,并設(shè)定需要傳遞的參數(shù)信息。由于顯示意圖指定了具體的組件對(duì)象,不需要設(shè)置intent的其它意圖過濾對(duì)象。[java]?//?1.創(chuàng)建Intent實(shí)例化對(duì)象幾種方式???Intentintent=newIntent();?intent.setClass(ContextpackageCon

    3、text,Classcls);?????//內(nèi)部調(diào)用setComponent(ComponentName)?intent.setClassName(ContextpackageContext,StringclassName);//內(nèi)部調(diào)用setComponent(ComponentName)?intent.setClassName(StringpackageName,StringclassName);??//內(nèi)部調(diào)用setComponent(ComponentName),可以激活外部應(yīng)用???intent.setComponent(

    4、newComponentName(this,Classcls));?intent.setComponent(newComponentName(this,"packageName"));?(2).隱式意圖(ImplicitIntents)沒有明確指定組件名的Intent為隱式意圖,系統(tǒng)會(huì)根據(jù)隱式意圖中設(shè)置的動(dòng)作(action)、類別(category)、數(shù)據(jù)URI等來(lái)匹配最合適的組件。1).actionThegeneralactiontobeperformed,suchasACTION_VIEW,ACTION_EDIT,ACTION_

    5、MAIN,包括Android系統(tǒng)指定的和自定義[java]?intent.setAction("com.baidu.action.TEST");?[html]viewplaincopy?2).dataexpressedasaUri,Thedatatooperateon,suchasapersonrecordinthecontactsdatabase.系統(tǒng)自帶的Action簡(jiǎn)單舉例ActionData(Uri)ContentACTION_VIEWcon

    6、tent://contacts/people/1Displayinformationaboutthepersonwhoseidentifieris"1".ACTION_VIEWtel:123Displaythephonedialerwiththegivennumberfilledin.ACTION_DIALtel:123Displaythephonedialerwiththegivennumberfilledin.?自定義data匹配[java]?intent.setData(Uri.parse("baidu://www.baidu.co

    7、m/news"));?[html]???3).categoryGivesadditionalinformationabouttheactiontoexecute.注意:項(xiàng)目清單的xml文件意圖過濾器中必須指定android.intent.category.DEFAULT類別,Activitieswillveryoftenneed

    8、tosupporttheCATEGORY_DEFAULTsothattheycanbefoundbyContext.startActivity,orContextcan'ttheacitivi

    當(dāng)前文檔最多預(yù)覽五頁(yè),下載文檔查看全文

    此文檔下載收益歸作者所有

    當(dāng)前文檔最多預(yù)覽五頁(yè),下載文檔查看全文
    溫馨提示:
    1. 部分包含數(shù)學(xué)公式或PPT動(dòng)畫的文件,查看預(yù)覽時(shí)可能會(huì)顯示錯(cuò)亂或異常,文件下載后無(wú)此問題,請(qǐng)放心下載。
    2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫(kù)負(fù)責(zé)整理代發(fā)布。如果您對(duì)本文檔版權(quán)有爭(zhēng)議請(qǐng)及時(shí)聯(lián)系客服。
    3. 下載前請(qǐng)仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
    4. 下載文檔時(shí)可能由于網(wǎng)絡(luò)波動(dòng)等原因無(wú)法下載或下載錯(cuò)誤,付費(fèi)完成后未能成功下載的用戶請(qǐng)聯(lián)系客服處理。