深层链接 Android 首先打开启动器活动(不是深层链接的活动),然后打开清单文件中声明的深层链接的活动。我已遵循此处提到的所有步骤。
\n\n即。清单包含
\n\n<activity\n android:name="com.example.android.GizmosActivity"\n android:label="@string/title_gizmos" >\n <intent-filter android:label="@string/filter_title_viewgizmos">\n <action android:name="android.intent.action.VIEW" />\n <category android:name="android.intent.category.DEFAULT" />\n <category android:name="android.intent.category.BROWSABLE" />\n <!-- Accepts URIs that begin with "http://www.example.com/gizmos\xe2\x80\x9d -->\n <data android:scheme="http"\n android:host="www.example.com"\n android:pathPrefix="/gizmos" />\n <!-- note that the leading "/" is required for pathPrefix-->\n <!-- Accepts URIs that begin with "example://gizmos\xe2\x80\x9d\n <data android:scheme="example"\n android:host="gizmos" />\n -->\n </intent-filter>\n</activity>\nRun Code Online (Sandbox Code Playgroud)\n\n和深度链接的活动包含
\n\n@Override\npublic void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n Intent intent = getIntent();\n String action = intent.getAction();\n Uri data = intent.getData();\n}\n …Run Code Online (Sandbox Code Playgroud)