1414import android .view .inputmethod .InputMethodManager ;
1515import android .widget .EditText ;
1616
17- import com .simplemobiletools .notes .Config ;
1817import com .simplemobiletools .notes .Constants ;
1918import com .simplemobiletools .notes .MyWidgetProvider ;
2019import com .simplemobiletools .notes .R ;
@@ -47,7 +46,7 @@ protected void onResume() {
4746 @ Override
4847 protected void onPause () {
4948 super .onPause ();
50- if (Config . newInstance ( getApplicationContext ()) .getIsAutosaveEnabled ()) {
49+ if (mConfig .getIsAutosaveEnabled ()) {
5150 saveText (false );
5251 }
5352 }
@@ -65,13 +64,13 @@ public void onBackPressed() {
6564 @ Override
6665 protected void onDestroy () {
6766 super .onDestroy ();
68- Config . newInstance ( getApplicationContext ()) .setIsFirstRun (false );
67+ mConfig .setIsFirstRun (false );
6968 }
7069
7170 @ Override
7271 public boolean onCreateOptionsMenu (Menu menu ) {
7372 getMenuInflater ().inflate (R .menu .menu , menu );
74- if (Config . newInstance ( getApplicationContext ()) .getIsAutosaveEnabled ())
73+ if (mConfig .getIsAutosaveEnabled ())
7574 menu .findItem (R .id .save ).setVisible (false );
7675
7776 return true ;
@@ -106,7 +105,8 @@ private void displayAutosavePrompt() {
106105 alertDialog .setPositiveButton (R .string .enable_autosave , new DialogInterface .OnClickListener () {
107106 @ Override
108107 public void onClick (DialogInterface dialog , int which ) {
109-
108+ mConfig .setIsAutosaveEnabled (true );
109+ supportInvalidateOptionsMenu ();
110110 }
111111 });
112112 alertDialog .create ().show ();
0 commit comments