Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I guess you are using using <strong>Viewpager and Imageviews</strong></p> <p><strong>About image views</strong> you are using powerful image downloading and caching library like latest <strong>Volley</strong> Imageloading(really helpful for large size images) to improve the image loading capabilities in a efficient way.</p> <p><strong>About Viewpager</strong> you have to use efficient adapter <strong>FragmentStatePagerAdapter</strong>: This version of the pager is more useful when there are a large number of pages, working more like a list view. When pages are not visible to the user, their entire fragment may be destroyed, only keeping the saved state of that fragment. This allows the pager to hold on to much less memory associated with each visited page as compared to FragmentPagerAdapter at the cost of potentially more overhead when switching between pages.</p> <p>please think before you are using FragmentPagerAdapter becouse it stores the whole fragment in memory, and could increase a memory overhead if a large amount of fragments are used in ViewPager. In contrary its sibling, FragmentStatePagerAdapter only stores the savedInstanceState of fragments, and destroys all the fragments when they lose focus. Therefore FragmentStatePagerAdapter should be used when we have to use dynamic fragments, like fragments with widgets, as their data could be stored in the savedInstanceState. Also it wont affect the performance even if there are large number of fragments. In contrary its sibling FragmentPagerAdapter should be used when we need to store the whole fragment in memory. When I say the whole fragment is kept in memory it means, its instances wont be destroyed and would create a memory overhead. Therefore it is advised to use FragmentPagerAdapter only when there are low number of fragments for ViewPager. It would be even better if the fragments are static, since they would not be having large amount of objects whose instances would be stored. Hope this clears out the difference between Android FragmentPagerAdapter and FragmentStatePagerAdapter.</p> <p>Try to learn <a href="https://android.googlesource.com/platform/packages/apps/Gallery.git" rel="nofollow">Google</a> android <a href="https://github.com/CyanogenMod/android_packages_apps_Gallery" rel="nofollow">gallary</a> app example, use image view loading animations to make a great user experience.</p> <p>I hope this will solves your grow heap problems.</p> <p>Credits:<a href="http://www.truiton.com/2013/06/android-fragmentpageradapter-vs-fragmentstatepageradapter/" rel="nofollow">FragmentPagerAdapter vs FragmentStatePagerAdapter</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload