Я создаю приложение для браузера, но Android не обнаружит мое приложение в Chooser, пока я нажимаю на любой URL - PullRequest
1 голос
/ 15 апреля 2020

Я создаю приложение для браузера и хочу, чтобы Android рассматривал мое приложение как браузер и отображался в окне выбора приложений для открытия. enter image description here

Я хочу, чтобы мое приложение отображалось в этом списке.

Вот мой манифест Код активности:

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

Ответы [ 2 ]

3 голосов
/ 15 апреля 2020

Замените свой намеренный фильтр на ниже,

 <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>
1 голос
/ 15 апреля 2020

Попробуйте изменить testcheme на "http" и "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>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...