Replace the banner on a width change instead of resizing it - #654
Merged
Conversation
AdView.setAdSize throws once the view has a size, and #643 made the view long-lived, so the first rotation that changed the banner width crashed the free app. Play's pre-launch report caught it on 4.19.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SG2XwLKA9P1wK629kp8cJq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AdView.setAdSizethrowsIllegalStateException: The ad size can only be set once on AdView, and #643 made theAdViewlong-lived, sorefreshAdsreachedsetAdSizea second time on the first rotation that actually changed the bannerwidth. The free app crashed out of
MainActivity.onConfigurationChanged.A width change now destroys the banner and adds a new one, which is what the
comment above it already said was needed.
hasAdresets with it, so a new viewthat fails to fill still falls back to the house ad and retries.
Found by Play's pre-launch report while promoting 4.19.0 — that release is held
and unsubmitted.
🤖 Generated with Claude Code