简体   繁体   English

启动到应用程序不适用于意图过滤器

[英]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 . 我使用www或不使用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 您尚未定义启动器点,这可能是一个可行的尝试原因

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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