Android - How the state of views are preserved during Fragment Transforamtion -


this confuses me lot.

i had 2 fragments, , use fragmenttransaction.replace() swap 2 fragments. state of input controls radiogroup , checkbox preserved when switch other fragments , switch again.

enter image description here.

i set break point on oncreateview() of fragment, , every swap seems trigger method , new views created each time. savedinstancebundle null well. since new views created, how state of old views?

public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {     view v =  inflater.inflate(r.layout.fragment_fieldsetup_marking, container, false);    // ...  return v; } 

this effect fine app, want know how implemented.

  1. where states stored?
  2. where android sdk code restore (i can not find in class fragmenttransection).


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -

java - How can I send the data from a imput type="file" to the controller? -