【问题标题】:I got problem when i update targetSdkVersion 29 to targetSdkVersion 30当我将 targetSdkVersion 29 更新为 targetSdkVersion 30 时出现问题
【发布时间】:2021-12-03 07:24:17
【问题描述】:

大家好,我的应用有问题,我将 targetSdkVersion 从 29 更新到 targetSdkVersion 30 或 31

我遇到了问题
应用程序适用于所有 android 版本 10、9、8、7 等

在安卓 11 中 我有按钮停止工作以从活动 1 更改为活动 2

来自第一个 java 活动的这个 java

                case 503:
                    if (this.mMainGalleryLayout.getVisibility() == View.VISIBLE) {
                        this.mMainGalleryLayout.setVisibility(View.GONE);
                    }
                    if (this.mPatternGalleryLayout.getVisibility() == View.VISIBLE) {
                        this.mPatternGalleryLayout.setVisibility(View.GONE);
                    }
                    if (this.mSeekbarLayout.getVisibility() == View.VISIBLE) {
                        this.mSeekbarLayout.setVisibility(View.GONE);
                    }
                    if (this.mGridLayout.getVisibility() == View.VISIBLE) {
                        this.mGridLayout.setVisibility(View.GONE);
                    }
                    if (this.mFrameRatiosGalleryLayout.getVisibility() == View.VISIBLE) {
                        this.mFrameRatiosGalleryLayout.setVisibility(View.GONE);
                    }
                    if (this.mCount < this.mFrameNumber) {
                        Toast.makeText(getApplicationContext(), "Please fill all the images.", Toast.LENGTH_SHORT).show();
                        return;
                    } else if (!this.nextButtonClick) {
                        this.nextButtonClick = true;
                        hideAllAdjustor();
                        disableAllGalleryLayouts();
                        this.mMainFrameLayout.setDrawingCacheEnabled(false);
                        this.mFinalBitmap = this.mMainFrameLayout.getDrawingCache(true);
                        String saveBitmap = saveBitmap("imageforaddingstickerandtext", 100, this.mFinalBitmap);
                        this.mMainFrameLayout.destroyDrawingCache();
                        File file = new File(saveBitmap);
                        if (file.exists()) {
                            OpenShareActivity();

                            Intent Intent = new Intent(this, ShareActivity.class);
                            startActivity(Intent);

                        }

                        return;
                    } else {
                        return;
                    }

this 2 pic will explain the problem when i press the save icon in pic should be move to this activity

【问题讨论】:

  • 返回 true 吗?如果(文件。存在())。 Android 30 需要围绕存储进行一些更改。 developer.android.com/about/versions/11/privacy/…
  • else if (!this.nextButtonClick) 那应该是:if (!this.nextButtonClick)
  • else { return; } 那应该是return; 如果 if 返回,则不需要 else。所有那些不需要的东西看起来都很丑。
  • 我删除它仍然是同样的问题

标签: javascript android android-studio sdk


【解决方案1】:

有什么问题?

您刚刚说“在 android 11 中,我有按钮停止工作以从活动 1 更改为活动 2”

这是否意味着这段代码不起作用?是否添加了一些调试日志来检查问题点?

else if (!this.nextButtonClick) {
                        this.nextButtonClick = true;
                        hideAllAdjustor();
                        disableAllGalleryLayouts();
                        this.mMainFrameLayout.setDrawingCacheEnabled(false);
                        this.mFinalBitmap = this.mMainFrameLayout.getDrawingCache(true);
                        String saveBitmap = saveBitmap("imageforaddingstickerandtext", 100, this.mFinalBitmap);
                        this.mMainFrameLayout.destroyDrawingCache();
                        File file = new File(saveBitmap);
                        if (file.exists()) {
                            OpenShareActivity();

                            Intent Intent = new Intent(this, ShareActivity.class);
                            startActivity(Intent);

                        }

                        return;
                    }

【讨论】:

  • 你好 tancolo 我添加图片你可以看看有什么问题谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-09-29
  • 1970-01-01
  • 2022-12-11
  • 1970-01-01
  • 2016-08-15
相关资源
最近更新 更多