Is there a problem in instantiating a Fragment twice?

0

I have a Fragment that is the first one to open, it's a list of items!

After depending on the button clicked on the Cards inside this fragment it opens a screen with a TabLayout with some tabs and one of those tabs is just that first fragment that is being reused but it should load another list of items. They are the same TYPE of items but it's another list !!!

Every time I try to do this it is instantiated by FragmentPagerAdapter with the same list when the APP was opened even calling the correct method to get another list !!!

    
asked by anonymous 11.07.2018 / 01:42

1 answer

1

There is no problem, as long as each call has a new instance, which is certainly the case. I have an application that has a single fragment for several moments and I never had any problems. Even it is always the best thing to take advantage of the codes as much as possible so as not to inflate the app unnecessarily.

I hope I have helped!

    
11.07.2018 / 05:37