Skip to main content
  1. About
  2. Stack Internal
The 2026 Annual Developer Survey is live— take the Survey today!

Return to Revisions

3 of 3
added 47 characters in body
Watermelon
  • reputation score 712
  • 5 silver badges
  • 5 bronze badges

Your Leak Canary log looks werid.

├─ android.widget.FrameLayout instance
│ Leaking: YES (View.mContext references a destroyed activity)
│ Retaining 89.6 kB in 1750 objects
│ View is part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mID = R.id.null
│ View.mWindowAttachCount = 0
│ mContext instance of android.view.ContextThemeWrapper, wrapping activity

FrameLayout is detached but it is also part of a window view hierarchy. How that could be possible?. I'm not sure but did you add FrameLayout directly to the window or used WindowManager like this?

// using window API
window.addContentView(FrameLayout(this), null)
// using acitivity API
[email protected](FrameLayout(this), null)
// using WindowManager API
windowManager.addView(FrameLayout(this), ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT))
Watermelon
  • reputation score 712
  • 5 silver badges
  • 5 bronze badges

AltStyle によって変換されたページ (->オリジナル) /