Skip to content

Commit 6bb8324

Browse files
author
Chris Warren-Smith
committed
ANDROID: fix race with graphics drawing while pausing
1 parent 5125712 commit 6bb8324

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/platform/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ android {
99
applicationId 'net.sourceforge.smallbasic'
1010
minSdkVersion 23
1111
targetSdkVersion 36
12-
versionCode 90
12+
versionCode 91
1313
versionName '12.33'
1414
resourceConfigurations += ['en']
1515
}

src/platform/android/app/src/main/java/net/sourceforge/smallbasic/MainActivity.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,15 @@ protected void onCreate(Bundle savedInstanceState) {
808808

809809
@Override
810810
protected void onPause() {
811-
super.onPause();
812811
onActivityPaused(true);
812+
// wait for Graphics::redraw() to complete
813+
try {
814+
Thread.sleep(10);
815+
}
816+
catch (Exception e) {
817+
// ignored
818+
}
819+
super.onPause();
813820
}
814821

815822
@Override

src/platform/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:9.1.0'
8+
classpath 'com.android.tools.build:gradle:9.1.1'
99
}
1010
}
1111

0 commit comments

Comments
 (0)