Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 708
Aashish Avatar asked Apr 20 '18 16:04

Aashish


People also ask

How do I add open with apps on Android?

To change default apps in Android, go to Settings > Apps > Default apps and pick which category you want to set a default app for. Then select the app you want to use for this category.

How do I show open with Android?

If you have a newer Android phone, swipe up from the bottom-right corner of the screen. If your phone has physical navigation buttons, press the square app switcher button next to the home button. There may also be an icon with three vertical lines to access the app switcher.

How do I get to the Android app list?

Tap the three horizontal lines at the top right of the screen and then, in the menu, tap "My apps & games." Here, you'll have two options. 3. At the top of the screen, tap "Installed." As the name suggests, this is a list of all the apps that are currently installed on this phone.


1 Answers

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>
like image 108
Rob Avatar answered Nov 14 '22 22:11

Rob