android 通過自己app調起其他app指定頁面

工作中有個需求,需要在自己的app裏面調起其他應用的指定頁面,在朋友的提醒下,用手機連着studio 調試,打開你要打開的應用,通過查看logcat 的輸出日誌,可以查看到他的 schema 路徑,然後在自己的項目中寫入以下代碼既可以喚起:

 

String url = "snssdk1128://user/profile/95627491132?refer=web&gd_label=click_wap_profile_bottom&type=need_follow&needlaunchlog=1";
try {
    Uri uri = Uri.parse(url);
    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
    startActivity(intent);
} catch (Exception e) {
    e.printStackTrace();
}

上面的url是通過在logcat裏面找到的

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章