【Android】顯式/隱式Intent意圖跳轉(zhuǎn)Activity總結(jié)

1.隱式跳轉(zhuǎn)之Action

<activity
android:name=".ScrollingActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="open_destination"/>
<categoryandroid:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

一定要加上 <category android:name="android.intent.category.DEFAULT" />,不然會(huì)爆錯(cuò):android.content.ActivityNotFoundException: No Activity found to handle Intent { act=open_destination }


QQ截圖20171202103046.png

2.URI跳轉(zhuǎn):

uri.png

需要注意的是: <action android:name="android.intent.action.VIEW" /> 必須要加上,否則跳不過去,同時(shí)注意host和scheme不要寫反了:


host.png

原文鏈接:http://blog.csdn.net/huanongjingchao/article/details/43162853
原文鏈接:http://blog.csdn.net/Xiong_IT/article/details/45071809

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 178,936評論 25 709
  • 在此特此聲明:一下所有鏈接均來自互聯(lián)網(wǎng),在此記錄下我的查閱學(xué)習(xí)歷程,感謝各位原創(chuàng)作者的無私奉獻(xiàn) ! 技術(shù)一點(diǎn)一點(diǎn)積...
  • 自定義控件學(xué)習(xí) https://github.com/GcsSloop/AndroidNote/tree/mast...
    皇小弟閱讀 2,427評論 0 36
  • 上周,因?yàn)樽约航o同事Q年休假報(bào)錯(cuò)了,導(dǎo)致同事沒有拿到區(qū)里給的補(bǔ)貼,大約一萬多塊。當(dāng)我接到電話時(shí),非常疑惑,我明明給...
    半天云閱讀 299評論 2 0
  • “傻瓜,我不照顧你誰照顧你?”少女親昵的笑道?!版海阏婧??!薄昂呛?,等你病好了,我們就可以回家了?!鄙倥琅f親昵...
    飛魚雷閱讀 325評論 0 0

友情鏈接更多精彩內(nèi)容