首页 > 解决方案 > android动态交付无法获得用户确认

问题描述

当用户取消需要用户确认的下载请求时,请求状态应该变为 CANCELED。但是,状态侦听器似乎没有收到该状态更改。下面是监听器的示例代码。任何想法?先感谢您!

switch(state.status()) {
    case SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION:
        try {
            getContext().startIntentSender(
                    state.resolutionIntent().getIntentSender(),
                    null,
                    0,
                    0,
                    0);
        } catch (Exception e) {
            Log.e(TAG, "stats onStateUpdate: ", e);
        }
        break;

    case SplitInstallSessionStatus.CANCELED:
        Log.d(TAG, "onStateUpdate: canceled”); 
        //NEVER GET TO THIS LINE
        break;
}

标签: androidandroid-app-bundle

解决方案


这个问题似乎在最近的更新 com.google.android.play:core:1.3.7 中得到了解决。升级后我们无法复制该问题。我们之前使用的是1.3.6。


推荐阅读