Skip to content

Replace the banner on a width change instead of resizing it - #654

Merged
andiwand merged 1 commit into
mainfrom
replace-banner-on-resize
Sep 5, 2026
Merged

Replace the banner on a width change instead of resizing it#654
andiwand merged 1 commit into
mainfrom
replace-banner-on-resize

Conversation

@andiwand

@andiwand andiwand commented Sep 5, 2026

Copy link
Copy Markdown
Member

AdView.setAdSize throws IllegalStateException: The ad size can only be set once on AdView, and #643 made the AdView long-lived, so refreshAds reached
setAdSize a second time on the first rotation that actually changed the banner
width. 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. hasAd resets with it, so a new view
that 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

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
@andiwand
andiwand merged commit 5d8e742 into main Sep 5, 2026
11 of 13 checks passed
@andiwand
andiwand deleted the replace-banner-on-resize branch September 5, 2026 09:40
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