[英]How to show my app in “Open with” list on android
我用webview
創建了一個簡單的應用程序,可以處理/打開任何URL。 但問題是,當我點擊任何超鏈接時,我的應用程序將不會以列表顯示。
如上圖所示,我單擊一個超鏈接,它彈出一個打開的列表,但我的應用程序沒有顯示在這里。 所以,我想顯示我的應用程序也顯示在此打開列表中。
清單代碼:
<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>
使用此intent過濾器添加另一個活動
<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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.