【发布时间】:2015-11-24 11:28:21
【问题描述】:
我正在尝试在我的应用程序中打开一组特定的活动,为此我在我的 AndroidManifest 文件中添加了一个自定义 uri 方案。
这里的问题是,当我在 TextView 中使用这些链接时,出现以下异常:
android.content.ActivityNotFoundException:找不到要处理的活动 意图 { act=android.intent.action.VIEW dat=numbers://imnumbers.com/buynumber(有附加)}
从 WebView(在 WebView 中单击链接)时,一切正常。我在网上广泛搜索了一个无济于事的解决方案。
这就是我为 TextView 解析 html 的方式:
textView.setText(Html.fromHtml(message.getContent()));
textView.content.setMovementMethod(LinkMovementMethod.getInstance());
我试过this answer,但它不起作用。当我点击链接时没有任何反应。
更新: 自定义uri方案定义如下:
<activity
android:name=".simcard.NewBuySimCardActivity"
android:label="@string/title_activity_new_buy_sim_card">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="imnumbers.com"
android:pathPrefix="/buynumber/"
android:scheme="numbers"/>
</intent-filter>
</activity>
【问题讨论】:
标签: android android-intent textview