While developing a very simple application I stumbled upon this strange behaviour when declaring the following lines to my AndroidManifest.xml:
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="com.example.appname"
android:host="myHost" />
Basically people can install the APK but the app disappears from the menu and can't be started anymore. Via Settings > Applications you can see that the app is installed.
So I've created a basic testcase, just a webview app with only one activity which loads the webview. Published it to the app store, as expected no problems. Pushed an update with the intent category, and same problem arrises. I can update to this newer version, but the app is removed from the home/app screen so it can't be launched.
Complete Manifestfile:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.appname"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="com.example.appname"
android:host="myHost" />
</intent-filter>
</activity>
</application>
The app runs fine when installed in emulator, or via ADB on device. The browsable declaration works fine.
You can declare different intent-filter for different actions.
<activity
android:name=".MainActivity"
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>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="www.example.com" android:pathPrefix="/prefix" />
</intent-filter>
</activity>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With