简体   繁体   中英

Intent filter doesn't seem to work

I was wondering if the host in an intentfilter is necessary. And if so, does the host need to actually exist.

This is what I've tried:

<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:host="hi10.android.be"
                android:pathPrefix="/eidsignature/"
                android:scheme="http" />
            <data
                android:host="www.hi10.android.be"
                android:pathPrefix="/eidsignature/"
                android:scheme="http" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

Then I put a link in my html:

<a href="http://hi10.android.be/eidsignature/">CLICK HERE</a>

Here's the thing. hi10.android.be doesn't exist. So I was wondering if this needs to be a valid host for it to activate my app. If so what host should I use, since the app is still in development and isn't hosted anywhere yet.

EDIT: this isn't working btw

No, it need not to be a valid host for using intent filter. as long as string in intent filter for host matches string in url for host. you are good to go.

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