我使用webview
创建了一个可以处理/打开任何网址的简单应用。但问题是当我点击任何超链接时,我的应用程序不会以打开列表显示。
如上图所示,我单击一个超链接,然后弹出一个打开的列表但我的应用程序未显示在此处。所以,我想显示我的应用程序也显示在此打开的列表中。
清单代码:
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="biz.coolpage.aashish.app.MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppTheme.Translucent.Light"
android:hardwareAccelerated="true"
android:launchMode="singleInstance"
android:alwaysRetainTaskState="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<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:mimeType="text/link"
android:scheme="http" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="text/plain"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
答案 0 :(得分:6)
使用此意图过滤器添加其他活动
<activity
android:label="MyBrowser" android:name="BrowserActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="http"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>