androidandroid-manifestopen-with

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.

image with open with list

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>

Solution

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