androidintentfilterandroid-intent-chooser

I am creating a Browser App but Android won't detect my app in chooser while I click on any URL


I am creating a Browser app and I want Android to treat my app as a browser and show up in the app chooser to open with. enter image description here

I want my app to show up in this list.

Here is my manifest Activity code:

<activity
        android:name=".Activity.LinkDetectorActivity"
        android:exported="true"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <data android:scheme="testscheme" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

Solution

  • Replace your intent-filter with below,

     <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="http"/>
            <category android:name="android.intent.category.DEFAULT" />
            <!-- The BROWSABLE category is required to get links from web 
            pages. -->
            <category android:name="android.intent.category.BROWSABLE" />
     </intent-filter>
    
    </activity>