I am having an Adapter activity that extends CursorAdapter
. So it has overriden
methods like newView()
, bindView()
. I am updating the viewholder with textview values often. This works good in portrait mode. When turned to landscape mode, the values dont persist.
I know that you need to use onSaveInstanceState
and onRestoreInstanceState
. But these are for activities and mine is an Adapter class. What do I do in this case?
In a Fragment Activity, I have -
@Override
public void onSaveInstanceState(Bundle outState) {
outState.putInt("Pos", mPosition);
super.onSaveInstanceState(outState);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
In my Adapter class,
I have th viewholder
in bindview()
. How do I access or use it in Fragment activity and save the values