当我更新targetSdkVersion 29到targetSdkVersion 30时,我遇到了问题



你好,我的应用程序有问题,我更新targetSdkVersion从29到targetSdkVersion 30或31

和我有问题
应用程序工作在所有android版本10,9,8,7等

在android 11我有按钮停止工作从活动1更改为活动2

this Java from first Java activity

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;
}

这个2 PIC将解释这个问题当我按下PIC中的保存图标时,应该移动到此活动

有什么问题吗?

你刚才说"在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;
}