It seems to be a problem with SherlockFragment, or atleast it is hard to find a solution.
Luckily you just want to save and create simple data, so my suggestion is saving to sharedPreference:
Save string in shared preferences and retrieve it again anywhere in your app.
public class PreferencesData {
public static void saveString(Context context, String key, String value) {
SharedPreferences sharedPrefs = PreferenceManager
.getDefaultSharedPreferences(context);
sharedPrefs.edit().putString(key, intValue).commit();
}
public static int getString(Context context, String key) {
SharedPreferences sharedPrefs = PreferenceManager
.getDefaultSharedPreferences(context);
return sharedPrefs.getString(key, defaultValue);
}
}
Usage:
PreferencesData.saveString(context, "mynote", "Sherlock is weird");
// retrieve
String note = PreferencesData.getString(context, "mynote");
Use this to save the string on pause, and recreate it in onActivityCreated
Hope this helps