0

When I add the following code in the AndroidManifest the app is missing (disappears) from my device.

<intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="https"
                  android:host="www.example.com"
                  android:pathPrefix="/gizmos"/>

</intent-filter>

If I don't add this code the app is installed and appears as it should be BUT I get warning:

App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter.

I already did research from official documentation and also this question but still my problem is different.

EDIT: Here is all my manifest:

    <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.CAMERA" />
        <uses-feature android:name="android.hardware.camera" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
            android:allowBackup="true"
            android:fullBackupContent="true"
            android:icon="@mipmap/icon"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme"
            android:screenOrientation="portrait">

            <activity android:name=".MainActivity"
                      android:theme="@style/FullScreenTheme"
                      android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
               <action android:name="android.intent.action.VIEW" />
               <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="https"
                  android:host="www.example.com"
                  android:pathPrefix="/gizmos"/>

    </intent-filter>

            <activity android:name=".AnimationScreenActivity"
                      android:theme="@style/FullScreenTheme"
                      android:screenOrientation="portrait"/>


            </activity>

        </application>
Community
  • 1
  • 1
Johny
  • 531
  • 5
  • 24

3 Answers3

1

You are not closing your intent filter right

    <activity android:name=".MainActivity"
                      android:theme="@style/FullScreenTheme"
                      android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
 </activity>
Haris ali
  • 753
  • 1
  • 13
  • 19
1

After @Harisali help, the solution is to separate it in two <intent-filter> like this:

<activity android:name=".MainActivity"
                  android:theme="@style/FullScreenTheme"
                  android:screenOrientation="portrait">
        <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.BROWSABLE" />
            <data android:scheme="https"
                      android:host="www.example.com"
                      android:pathPrefix="/gizmos"/>

       </intent-filter>
</activity>
Johny
  • 531
  • 5
  • 24
0

Uninstall the app and run the code, sometimes the old package might be overwritten.

Meena Dev
  • 78
  • 1
  • 9