尝试使用textview处理http
Pattern httpMatcher = Pattern.compile("https?://.*");
String httpViewURL = "myhttp";
Linkify.addLinks(label, httpMatcher, httpViewURL);
清单文件:
<activity android:exported="false"
android:name="*****.URLClickedActivity">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="myhttp" />
</intent-filter>
</activity>
无论如何我得到了这个:
找不到处理Intent的活动{act = android.intent.action.VIEW dat = (有额外内容)} *
答案 0 :(得分:4)
方案
String httpViewURL = "myhttp";
应该阅读
String httpViewURL = "myhttp://";