Skip to content

fix-rollbar (7610/464998512971): Fix HealthPermissionsRationaleActivity crash due to action bar theme conflict#612

Open
astashovai wants to merge 1 commit into
astashov:masterfrom
astashovai:fix/rollbar-464998512971
Open

fix-rollbar (7610/464998512971): Fix HealthPermissionsRationaleActivity crash due to action bar theme conflict#612
astashovai wants to merge 1 commit into
astashov:masterfrom
astashovai:fix/rollbar-464998512971

Conversation

@astashovai

Copy link
Copy Markdown
Contributor

Summary

  • Fixed IllegalStateException crash in HealthPermissionsRationaleActivity on Android
  • Changed AppCompatTheme parent from Theme.AppCompat.Light.DarkActionBar to Theme.AppCompat.Light.NoActionBar

Rollbar

https://app.rollbar.com/a/astashov/fix/item/liftosaur/7610/occurrence/464998512971

Decision

Fixed — this is a real crash affecting users who open the Health Connect permissions rationale screen on Android.

Root Cause

The AppCompatTheme style used Theme.AppCompat.Light.DarkActionBar as its parent, which provides a window-decor action bar. However, HealthPermissionsRationaleActivity.onCreate() also calls setSupportActionBar(toolbar) with a Toolbar widget from the layout. Android throws IllegalStateException because you cannot set a support action bar when the theme already supplies one via the window decor. The fix is to use NoActionBar as the parent theme so the custom Toolbar widget is used instead.

Test plan

  • Build Android APK and launch the Health Connect permissions rationale screen
  • Verify the toolbar displays correctly with back navigation and title

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.

1 participant