Add intent-filter within the configuration node of the activity that needs to be opened
<Intent-filter> <DataAndroid:scheme= "@string/link_scheme_name"Android:host= "@string/link_host" /> <categoryAndroid:name= "Android.intent.category.BROWSABLE" /> <categoryAndroid:name= "Android.intent.category.DEFAULT" /> <ActionAndroid:name= "Android.intent.action.VIEW" /> </Intent-filter>
Get data in an open activity
// get schema Intent Intent = this .getintent (); String schema = Intent.getscheme (); Uri Uri = Intent.getdata (); if ((Schema!=null ) && Schema.equals (getString (r.string.link_scheme_name)) && (uri! = null Span style= "color: #000000;" ) {String Value = uri.getqueryparameter ("id") + uri.getqueryparameter ("nickname") + Uri.getqueryparame ter ("Packgename" ); System.out.println (value); Toast.maketext (Mcontext, Value, Toast.length_long). Show (); }
URL example "Cz365://m.cz365.com?id=1234&nickname=john&packgename=com.qixiao.app"
<stringname= "Link_scheme_name">cz365</string> <stringname= "Link_host">M.cz365.com</string><ahref= "Cz365://m.cz365.com?id=1234&nickname=john&packgename=com.qixiao.app">Test</a>
URL opens Android app and comes with data