找回密碼
 註冊
搜索
查看: 4534|回復: 0

[Android] 從 APP 中執行外部 APP

[複製鏈接]
發表於 2013-9-25 15:41:46 | 顯示全部樓層 |閱讀模式
從 APP 中執行外部 APP
  1. Intent intent = getPackageManager().getLaunchIntentForPackage("com.iiordanov.freebVNC");
  2. startActivity(intent);
複製代碼
從 APP 中執行外部的 APP,如果APP不存在,則開啟Google Play APP頁面,再沒有則開啟Google Play網頁版
  1. String sParam = "com.google.android.apps.plus";
  2. try
  3. {
  4.     // Open app with Google Play app
  5.     intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+sParam));
  6.     startActivity(intent);
  7. }
  8. catch (android.content.ActivityNotFoundException anfe)
  9. {
  10.     // Open Google Play website
  11.     intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id="+sParam));
  12.     startActivity(intent);
  13. }
複製代碼
Reference:
從 APP 中執行外部的 APP
http://ephrain.pixnet.net/blog/p ... %E9%83%A8%E7%9A%84-
開啟 Google Play app 至指定的 app
http://ephrain.pixnet.net/blog/post/47272322
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|彩色筆小沛的知識庫

GMT+8, 2024-3-29 22:28 , Processed in 0.015389 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表