简体   繁体   中英

Should a ViewPager fragments be destroyed when activity is paused?

I am wondering about proper ViewPager usage. I have an application with 2 activities. First of it is a ViewPager activity with a ListFragment. When I choose an element in list another activity starts and the main is paused of course. My question is: should the fragments in ViewPager be destroyed to save memory? If yes what is the best way to implement it? initialise and release ViewPager in onPause/onResume methods?

您不应该在暂停时破坏视图。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM