简体   繁体   中英

How to show my app in “Open with” list on android

I create a simple app with webview that can handle/open any URL. But the problem is that my app will not be shown in open with list when I click on any hyperlinks.

图像打开列表

As shown in above image I click on a hyperlink and it popup an open with list but my app is not shown here. So, I want to show my app also shown in this open with list.

Manifest code:

<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>

Add another activity with this intent filter

 <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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM