i am using different fragments in my app. I want to reuse same fragments for some purpose. For example i have fragemntA with a listview. On list item click i want to add the same fragment again with some other data populated in that list.Again when on item click i want to launch another instance of the same fragment with another data. Like this i have to add many fragments. It is decided by response from server. And i want to add these fragemnts to backstack as well. Is it possible? Then how?
Asked
Active
Viewed 2,365 times
1 Answers
0
The FragmentManager class is what you are looking for. Here is a post that shows how to use it.
-
1U are mistaken..i want to load another instance of same fragment..not another fragemnnt – andro-girl Apr 10 '15 at 12:47
-
When you create another instance of a fragment class, you basically create another fragment. You can replace a Fragment fragment1 by a Fragment fragment2. – PMerlet Apr 10 '15 at 12:53
-
Suppose you want to update listview of fragmentA, right? – Xcihnegn Apr 10 '15 at 14:42