【发布时间】:2012-03-26 07:15:30
【问题描述】:
我收到一个 ActivityNotFound 异常,调用如下:
Intent displayModule = new Intent(Intent.ACTION_MAIN);
displayModule.addCategory(Intent.CATEGORY_DEFAULT);
displayModule.setType("application/x-content");
displayModule.putExtra(Modules.Plan_ID, holder.planId);
displayModule.putExtra(Modules.Module_ID, holder.moduleId);
startActivity(displayModule);
添加默认类别没有区别。
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW typ=application/x-content (has extras) }
或
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.DEFAULT] typ=application/x-content (has extras) }
当我尝试引用此活动时:
<activity android:name=".ContentActivity" >
<intent-filter>
<action android:name="android.intent.action.VIEW" >
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/x-content" />
</action>
</intent-filter>
</activity>
此外,如果它有助于我在片段中执行此操作
【问题讨论】:
-
告诉我你开始活动的电话
-
出于这个原因,我在顶部包含了来自 logcat 的行。无论如何,我已经更新了问题
标签: android android-intent android-fragments mime-types implicit