测试地址:

http://qzs.qq.com/open/yyb/wxz_tools/html/schemetools.html?type=1&pkg=net.whty.app.eyu&sch=jxb://open/ssologin?ticket=dUUxNTZjNjhiMTQtMDYzNy00MDBmLTg2OGItMTQwNjM3NDAwZjU1MTU1NTEzMzI0NDgzMw==&sysCode=320585

测试跳转
<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="open"
        android:path="/ssologin"
        android:port="8080"
        android:scheme="jiaxiaobang" />
</intent-filter>

//jiaxiaobang://open:8080/ssologin?ticket=xxticket&sysCode=xxxxxsysCode
Uri uri = getIntent().getData();
if (uri != null) {
    // 完整的url信息
    String url = uri.toString();
    Log.i(TAG, "url:" + uri);
    // scheme部分
    String scheme = uri.getScheme();
    Log.i(TAG, "scheme:" + scheme);
    // host部分
    String host = uri.getHost();
    Log.i(TAG, "host:" + host);
    // port部分
    int port = uri.getPort();
    Log.i(TAG, "port:" + port);
    // 访问路劲
    String path = uri.getPath();
    Log.i(TAG, "path:" + path);
    String ticket = uri.getQueryParameter("ticket"); 
    String sysCode = uri.getQueryParameter("sysCode"); 
    Log.i(TAG, "ticket:" + ticket);
    Log.i(TAG, "sysCode:" + sysCode);
    List<String> pathSegments = uri.getPathSegments();
    // Query部分
    String query = uri.getQuery();
    Log.i(TAG, "query:" + query);
    //获取指定参数值
    String success = uri.getQueryParameter("query");
    Log.i(TAG, "success:" + success);
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注