Skip to content

fix: WindowDimensionListener behavior when Activity restarts#1422

Merged
kirillzyusko merged 2 commits intomainfrom
fix/window-insets-listener-on-android
Apr 6, 2026
Merged

fix: WindowDimensionListener behavior when Activity restarts#1422
kirillzyusko merged 2 commits intomainfrom
fix/window-insets-listener-on-android

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented Apr 2, 2026

📜 Description

Re-register WindowDimensionListener.kt when Activity gets re-created.

💡 Motivation and Context

Closes #1334 #1241

📢 Changelog

Android

  • set listenerID = -1 in detachListener;
  • store listenerContext;
  • call listener?.detachListener() if contexts are not equal and attach new listener;

🤔 How Has This Been Tested?

Tested manually on Pixel 7 Pro (API 36).

📸 Screenshots (if appropriate):

telegram-cloud-document-2-5366269797619245228.mp4

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

📊 Package size report

Current size Target Size Difference
310116 bytes 310072 bytes 44 bytes 📈

@kirillzyusko kirillzyusko force-pushed the fix/window-insets-listener-on-android branch from fcbf12a to 12cb237 Compare April 2, 2026 08:55
@kirillzyusko kirillzyusko marked this pull request as ready for review April 6, 2026 09:20
@kirillzyusko kirillzyusko merged commit 51fbe47 into main Apr 6, 2026
19 of 20 checks passed
@kirillzyusko kirillzyusko deleted the fix/window-insets-listener-on-android branch April 6, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 android Android specific 🐛 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] Memory leak: KeyboardControllerViewManagerImpl retains WindowDimensionListener holding destroyed Activity view hierarchy

1 participant