发布应用程序后,应用程序更新中的android不起作用

问题描述

我编写了以下代码以在 Playstore 中有可用更新时显示自定义弹出窗口。但弹出窗口从未出现。

    // Creates instance of the manager.
    AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);

   // Returns an intent object that you use to check for an update.
    Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();

   // Checks that the platform will allow the specified type of update.
    appUpdateInfoTask.addOnSuccessListener(new OnSuccessListener<AppUpdateInfo>() {
        @Override
        public void onSuccess(AppUpdateInfo appUpdateInfo) {

            if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE){




                openDialog(context);
            }

        }
    });

我不知道我的代码有什么问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)