Skip to content

Fix Console tab crash after a screen size change - #185

Merged
zeevy merged 1 commit into
masterfrom
fix/console-tab-restore-crash
Oct 10, 2026
Merged

zeevy merged 1 commit into
masterfrom
fix/console-tab-restore-crash

Conversation

@zeevy

@zeevy zeevy commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Fixes this crash from the Play Console (v2.59 to v2.61):

java.lang.ClassCastException: android.view.View$BaseSavedState cannot be cast to android.widget.ScrollView$SavedState
  at android.widget.ScrollView.onRestoreInstanceState
  ...
  at in.co.gorest.grblcontroller.GrblActivity$2.onTabSelected
  • Cause: console_scroll_view was a FrameLayout in layout/fragment_console_tab.xml (since dce94d7) but a ScrollView in layout-large/fragment_console_tab.xml. State saved under that id on a phone size was restored into the ScrollView after the screen became large (fold open, window resize), when the Console tab was opened again.
  • Fix: remove the unused id from the phone FrameLayout. No code reads it. No other id in layout/ and layout-large/ has this type mismatch.
  • Checked on the emulator: open Console, go to Jog, change the screen from 1080x2400 to 2560x1600 (wm size, wm density), open Console. Crashed before the fix, opens now. The reverse (large to phone) also opens. The phone Console tab looks the same as before.
  • ./gradlew build passes locally.

console_scroll_view was a FrameLayout in the phone console layout and a
ScrollView in the large layout. State saved under that id on a phone
size was restored into the ScrollView after the screen became large
(fold open, window resize), so opening the Console tab threw
ClassCastException in ScrollView.onRestoreInstanceState.

Drop the unused id from the phone FrameLayout.
@zeevy
zeevy merged commit c2036f2 into master Oct 10, 2026
13 checks passed
@zeevy
zeevy deleted the fix/console-tab-restore-crash branch October 10, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants