2

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>
Marcel Bro
  • 4,907
  • 4
  • 43
  • 70
Pritam Pawade
  • 637
  • 7
  • 21

2 Answers2

3

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>
Prashant.J
  • 739
  • 7
  • 12
  • updated answer. also pls check the url which you are clicking? is it http or https? if https then add that scheme too. – Prashant.J Apr 15 '20 at 18:29
1

Try to change testcheme to "http" and "https"

<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="http" />
        <data android:scheme="https" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.BROWSABLE" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>
akashzincle
  • 1,108
  • 6
  • 15
  • sharing 2 links of 2 browser projects, check their manifest, try changes in ur manifest too https://github.com/scoute-dich/browser/blob/master/app/src/main/AndroidManifest.xml https://github.com/arunkumar9t2/lynket-browser/blob/master/android-app/app/src/main/AndroidManifest.xml – akashzincle Apr 15 '20 at 18:12