简体   繁体   中英

Intent filter browsable not work

This is my intent but not work. All browser start but my app is not in list, this is my Manifest:

<activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan">
            <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.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="http" android:host="www.googal.com" android:path="/*" />
            </intent-filter>
        </activity>

Try This:

               <activity
                    android:name=".MainActivity"
                    android:configChanges="orientation|keyboardHidden"
                    android:label="@string/app_name"
                    android:screenOrientation="portrait"
                    android:windowSoftInputMode="adjustPan">
                    <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.DEFAULT" />
                        <category android:name="android.intent.category.BROWSABLE" />
                        <data android:scheme="http" android:host="www.googal.com" />
                    </intent-filter>
                    <intent-filter>
                        <action android:name="android.intent.action.VIEW" />
                        <category android:name="android.intent.category.DEFAULT" />
                        <category android:name="android.intent.category.BROWSABLE" />
                        <data android:scheme="http" android:host="www.googal.com" />
                    </intent-filter>
                </activity>

Try this way.

<data android:scheme="http" />
<data android:host="www.googal.com" />
<data android:pathPrefix="/"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM