Fix no-op DatabasesActivity crash on Theme.NoDisplay#122
Conversation
…nCreate() Co-authored-by: KCeh <20267231+KCeh@users.noreply.github.com>
|
|
I don't think this is a proper fix, but I will investigate (try to reproduce) |
|
After a bit of research, it seems this might be fix 🤔 The
There is also alternative: |
|
I was able to reproduce bug (but not in the normal way of using sample app, only when forcing invocation of DatabasesActivity from no-op module): Fix in this PR resolves issue. |



Summary
The no-op
DatabasesActivitycrashes withIllegalStateException: Activity did not call finish() prior to onResume() completingon Android 6.0+. Activities usingTheme.NoDisplaymust callfinish()before lifecycle reachesonResume().Related issue: #113
Changes
Type
Additional information
Description
Override
onCreate()in no-opDatabasesActivityto callfinish()immediately aftersuper.onCreate():The no-op manifest declares this activity with
android:theme="@android:style/Theme.NoDisplay". Without an explicitfinish()call, the Android framework throwsIllegalStateExceptionwhen the activity lifecycle continues pastonCreate().Checklist
Additional notes
No-op module has no test infrastructure. The fix follows standard Android pattern for
Theme.NoDisplayactivities.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dl.google.com/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.