Home > Mobile >  Use viewpage and fragment the navigation effect of how to implement this APP?
Use viewpage and fragment the navigation effect of how to implement this APP?

Time:09-19

In the use of viewpage similar news navigation effect when encounter problems, fragments was destroyed after the switch, load data, how to put this data stored?

CodePudding user response:

Every time you switch has built a fragment?

CodePudding user response:

Destroyed, will create again, or you set the viewpager setOffscreenPageLimit for fragments could total number, don't let it destroy

CodePudding user response:

News page over twenty, all cached, lower in the configuration of mobile phone finally will be destroyed,

CodePudding user response:

reference 1st floor LightLi4869 response:
every time you switch has built a fragment?
viewpage fragments inside will be destroyed after delimit, don't put all the fragments of the cache,

CodePudding user response:

Listen to like the picture didn't optimize, eaten, can consider to open individual process to save data and for image processing,

CodePudding user response:

With fragmentadapter?

CodePudding user response:

Feel destroyed very normal, if demand really need cache, fragments have SavedState, you can put the data into a json preserved when destroyed, rebuilt out again, similar to the operation of the Activity

CodePudding user response:

Cache the data, not cache the yes

CodePudding user response:

Page,,,,

reference only funny reply on the eighth floor:
cache data, not cache the yes
  • Related