android - Why my ViewPager's Fragments are retained by FragmentActivity -
in fragmentactivity
, have fragment
(let's call hubfrag) has viewpager
using fragmentstatepageradapter
(which create fragments, let's call them 'itemfrag').
when replace hubfrag new fragment
,hubfrag destroyed expected it's not case itemfrags objects. using eclipse mat see itemfrags objects retained fragmentmanagerimpl
of fragmentactivity
... why????
i explain why don't want them still in memory:
each itemfrag launch picture download , downloader (which has weakreference
of itemfrag imageview
)don't want process bitmap
if weak reference null(to reduce memory use).
but downloader decode bitmap
weak reference never null... thanks!
i found cause problem: populate hubfrag's viewpager
using getsupportfragmentmanager
, using getchildfragmentmanager
resolved problem.
Comments
Post a Comment