简体   繁体   中英

Launch to app not work with intent-filter

I read all topic about intent-filter and test all method for app from browser but not work . this is my manifest :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ir.nooraei.afsaneirani.android.graphic"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="22" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar" >

        <activity
            android:name="com.main.da"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <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"/>
                <data android:host="anysite.com"/>
                <data android:host="google.com"/>
                <data android:host="www.google.com"/>
                <data
                    android:host="bestnews.com"
                    android:scheme="http" />
            </intent-filter>
        </activity>

 <activity
            android:name="com.main.da"
            android:label="@string/title_activity_splash_screen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
 </application>
</manifest>

i test this code for all site with www or without www . but not work :( . anyone can help me?

Add below line to your intent-filter

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
  • You haven't define your launcher point that could be a reason try it if it works

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