I am using action bar fragment in my app.When screen rotates contents of action bar lost please suggest how to retain them. Here is the code i am doing for that
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if(currentDisplayedCase != null) {
outState.putInt(DISPLAY_CASE_KEY, currentDisplayedCase.intValue());
}
outState.putString(ACTION_BAR_TEXT, textView1.getText().toString());
}
and in onCreate method
if(savedInstanceState!=null&&savedInstanceState.containsKey(ACTION_BAR_TEXT))
textView1.setText(savedInstanceState.getString(ACTION_BAR_TEXT, null));