我按照https://developer.android.com/training/app-indexing/deep-linking.html上的说明进行操作,但是当我想触发意图adb时:
adb shell am start
-W -a android.intent.action.BROWSEABLE
-d "http://example.com/gizmos" com.myapp.android
Run Code Online (Sandbox Code Playgroud)
我得到了
Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=example://gizmos flg=0x10000000 pkg=com.myapp.android }
<activity
android:name=".activities.DeepLinkActivity"
android:label="@string/title_activity_deep_link">
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
<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="example.com"
android:pathPrefix="/gizmos" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
我有任何明显的错误吗?
Android deep linking is not working
===================================
Android link:-notification://id=notificationid
Run Code Online (Sandbox Code Playgroud)
1:-在清单中
<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="id"
android:scheme="notification" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
2:-和编码端
@Override
protected void onResume() {
super.onResume();
Intent intent = getIntent();
String string=intent.getAction();
Uri data = intent.getData();
Log.d("hello","cgbdsuyfdkv");
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用请任何人都可以帮助我!!!!!
我正在关注Android开发者文档中的应用内容创建深层链接,以创建Android应用中活动的深层链接.
新的应用程序项目,我已经指定了与该教程完全相同的活动:
<activity
android:name="com.example.android.GizmosActivity"
android:label="@string/title_gizmos" >
<intent-filter android:label="@string/filter_view_http_gizmos">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="/gizmos" />
<!-- note that the leading "/" is required for pathPrefix-->
</intent-filter>
<intent-filter android:label="@string/filter_view_example_gizmos">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://gizmos” -->
<data android:scheme="example"
android:host="gizmos" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
当我测试adb shell am start -W -a android.intent.action.VIEW -d "example://gizmos" com.example.android它的工作原理.手机上的操作系统启动了应用程序. …