InterviewSolution
| 1. |
If a service is implementing the method of onStartCommand(), then what are the ways a service must be stopped after the task is completed? |
|
Answer» The main difference between FragmentPagerAdapter and FragmentStatePagerAdapter is FragmentPagerAdapter stores the whole fragment in memory, and If we used a large amount of Fragment in ViewPager it will increase memory while FragmentStatePagerAdapter only stores the savedInstanceState of fragments, and destroys all the fragments when they lose focus. FragmentPagerAdapter stores the previous DATA which is fetched from the adapter while FragmentStatePagerAdapter TAKES the new value from the adapter every time it is EXECUTED. Let's take an example of Book Reader APPLICATION here. I will use FragmentStatePagerAdapter and if I am CREATING an application which will store heavy data, then I will use FragmentPagerAdapter. |
|