Skip to content

Commit

Permalink
Do not retain fragment instance
Browse files Browse the repository at this point in the history
And possibly another fix for #1

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>
  • Loading branch information
daniele-athome committed Mar 1, 2015
1 parent 8b73137 commit 3241f1d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ public void onSaveInstanceState(Bundle outState) {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setRetainInstance(true);
setHasOptionsMenu(true);
}

Expand Down Expand Up @@ -386,8 +384,9 @@ private void onDatabaseChanged() {

/** Updates offline mode menu. */
private void updateOffline() {
if (mOfflineMenu != null) {
boolean offlineMode = Preferences.getOfflineMode(getActivity());
Context context = getActivity();
if (mOfflineMenu != null && context != null) {
boolean offlineMode = Preferences.getOfflineMode(context);
int icon = (offlineMode) ? R.drawable.ic_menu_start_conversation :
android.R.drawable.ic_menu_close_clear_cancel;
int title = (offlineMode) ? R.string.menu_online : R.string.menu_offline;
Expand Down

0 comments on commit 3241f1d

Please sign in to comment.