2 android deep-linking intentfilter
我正在尝试向我的应用程序添加深层链接,当我添加时:
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="/gizmos" />
Run Code Online (Sandbox Code Playgroud)
对于我的 MainActivity 中的意图过滤器,编译后图标未安装在设备中。
这是清单上的活动部分:
<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="/gizmos" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
小智 7
您需要两个单独的intent-filter.
<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.xxx.com"
android:pathPrefix="/app" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1159 次 |
| 最近记录: |