工作中有個需求,需要在自己的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裏面找到的