报错堆栈:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.xxx.bbbb.action.camera.gotolist flg=0x10000000 pkg=com.xxx.bbbb }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2007)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1673)
at android.app.ContextImpl.startActivity(ContextImpl.java:918)
mico_x10a:/ $ am start-activity -a com.xxx.bbbb.action.camera.gotolist
Starting: Intent { act=com.xxx.bbbb.action.camera.gotolist }
Error: Activity not started, unable to resolve Intent { act=com.xxx.bbbb.action.camera.gotolist flg=0x10000000 }
有问题的Action定义:
<activity
android:theme="@ref/0x7f0f00a3"
android:name="com.xxx.bbbb.camera.page.CameraListActivity"
android:exported="true"
android:launchMode="3"
android:screenOrientation="0">
<intent-filter>
<action
android:name="com.xxx.bbbb.action.camera.gotolist" />
</intent-filter>
</activity>
没问题的Action定义:
<activity
android:theme="@ref/0x7f0f00a3"
android:name="com.xxx.bbbb.camera.page.CameraListActivity"
android:exported="true"
android:launchMode="3"
android:screenOrientation="0">
<intent-filter>
<action
android:name="com.xxx.bbbb.action.camera.gotolist" />
//关键是这里
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
总结:
intent-filter 里面除了要有action 还要有 <category android:name="android.intent.category.DEFAULT" />
文章来源地址https://www.toymoban.com/news/detail-523556.html
文章来源:https://www.toymoban.com/news/detail-523556.html
到了这里,关于解决No Activity found to handle Intent的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!