Open thmiles opened 9 years ago
If View is designed to retain its view's state internally, it would be retained when fragment is back from backstack.
Please try the following cases:
Case 1: TextView without android:freezeText=true <== TextView's text would not be retained
Case 2: TextView with android:freezeText=true (and don't forget to assign android:id as well) <== TextView's text would be retained
Case 3: EditText with android:id assigned <== EditText's text would be retained.
Anyway the point is when you choose to use those 3rd party View(s) available over the internet, I found that those views are rarely implemented an internal view state saving/restoring. That's why we need a workaround and it becomes StatedFragment in this repository.
i have read your blog http://inthecheesefactory.com/blog/best-approach-to-keep-android-fragment-state/en great work, and i wrote some example base on Case 2: Fragment in Back Stack, But the result is not the same as what you said,although onSaveInstanceState is not called, the view state is retained ,here is piece of code:
public class DynamicFragmentA extends Fragment {