【发布时间】: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;
}
【问题讨论】:
-
返回 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