florent37 / MaterialViewPager

A Material Design ViewPager easy to use library
https://www.fiches-plateau-moto.fr
Apache License 2.0
8.13k stars 1.48k forks source link

ViewPager with setOffscreenPageLimit #154

Open krzysiek-icomapss opened 9 years ago

krzysiek-icomapss commented 9 years ago

My English is bad but i will try explain the problem which I encountered. Material VIewPager is not prepare for situations when i want to have in memory only some fragments and build new ones when user want to see them (ex. I have 15 tabs). Most important is fact that there is method for example registerRecyclerView and in sample u just do it in onVIewCreated. Everything is fine if all fragments are created in starting activity but when u create theme during using app than it will start memory leaks, because there is no method like unregister - or maybe i havent seen one.

Ashok-Varma commented 9 years ago

There is a method to unregister you can pass context to unregister all those related to that context

krzysiek-icomapss commented 9 years ago

I just want to unregister one fragment not all related to context- because one fragment in the moment is destroyed and another is created (normal use of ViewPager when u scroll horizontally and u have specified setOffscreenPageLimit to default 1).

geetak1997 commented 8 years ago

hi, i am getting error while importing florent37 viewpager . Anybody help me out Plese. my mail id dayashankargupta86@gmail.com

DKholevinsky commented 8 years ago

Sorry for my english The question is relevant to a memory leak! When flipping pages onDestroyView occurs, but the memory is not freed. Apparently due to hashMap MaterialViewPagerHelper that stores links to all RecyclerView