Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲

Android 如何開啟 Google Play 的我的下載頁面

編輯:關於 Android 程式設計

若要從應用程式跳到 Google Play 的「我的下載」或應用程式頁面,可透過 Intent 指定 action 與 component。

public void moveToGooglePlay() throws Exception {
    Intent i = new Intent("com.google.android.finsky.VIEW_MY_DOWNLOADS");
    i.setComponent(new ComponentName("com.android.vending", "com.android.vending.AssetBrowserActivity"));
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(i);
}

實務上需注意不同裝置、不同 Google Play 版本可能導致 component 名稱或 action 不相容,因此正式環境建議加入例外處理或改用較通用的 Market intent。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © Android教程網 All Rights Reserved