Mr.Smile填坑记——点击分享出去的网页,无法跳转自己的app

来源:互联网 发布:少年心气 知乎 编辑:程序博客网 时间:2024/06/11 07:41
首先需要和web端的开发制定规则,也就是安卓中的 schemetest://xxx?params=scheme://host:port/path一般host:port就是IP,端口号,正式的或者直接用域名就OKscheme 这个就是我遇到的坑,必须小写,必须小写,必须小写,重要的话说3pathPattern 就是后面匹配的东西在manifest中配置 <activity android:name=".webapi.WebEntityActivity"            android:configChanges="keyboardHidden|orientation"            android:screenOrientation="portrait"            android:launchMode="singleTask"            android:windowSoftInputMode="stateAlwaysHidden">            <intent-filter>                <action android:name="android.intent.action.VIEW" />                <category android:name="android.intent.category.BROWSABLE" />                <category android:name="android.intent.category.DEFAULT" />                <data android:host="xxxx" android:scheme="test" />            </intent-filter>         </activity>WebEntityActivityUri data = getIntent().getData();String params = data.getQueryParameter("params");params就是web端 返回给我们的数据,就是?后面的数据再次说明 scheme必须小写,必须小写,必须小写
阅读全文
0 0
原创粉丝点击