1

I have one fragment that is used as nested fragment in two other fragments. The scenario is as follows:

Fragment A --> has nested Fragment C (Instance C1) Fragment B --> has nested Fragment C (Instance C2)

(Fragment A and Fragment B are different top-level screens called from the NavigationDrawer, Fragment C also has its own nested fragment, if it means something to you)

Fragment C contains input fields with validation and save() action/method.

When I am in fragment A (with nested fragment C), if all input fields are non-empty the action save() is processed successfully (expected behavior).

However, If I go to Fragment B (which has its own nested instance of fragment C) and I intentionally leave input fields empty I get my own validation message "All fields are required" (expected), and then the weird part comes in. If I go back to my fragment A now, even though the input fields of my nested fragment C (inside A) are non-empty, on save() I get the message "All fields are required" that was triggered in Fragment B.

What it is that keeps the two instances of the same nested fragment linked together :( !? How can a fragment instance be independent of other fragment instances

Speed Demon
  • 691
  • 1
  • 9
  • 21
  • Can you please post the code that instantiates Fragment C? – Egor Jan 11 '14 at 15:02
  • Take a look at this answer: http://stackoverflow.com/questions/6847460/fragments-within-fragments/6847770#6847770. Do you target Android 4.2 or make use of the support library rev 11? – tiguchi Jan 11 '14 at 15:07

0 Answers0