temnoi temnoi - 5 months ago 7
Android Question

Prevent field from adding to savedInstanceBundle

Is there are any way to not include the field in

saveInstanceBundle
in Android when
void onSaveInstanceState(Bundle outState)
is called?

Answer

Fields are not added automatically. You have to write/read each one by yourself. If that's your case, just don't do anything with that field.

If there's a field which is already added (like visibility or text in TextView), you have to find it and remove it after calling super.onSaveInstanceState().

Comments