Added restart reasons

pull/209/head
M66B 2 years ago
parent 1d9340f7bc
commit a73de95291

@ -64,7 +64,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
@Override
public void onClick(View v) {
prefs.edit().putBoolean("accept_unsupported", true).commit();
ApplicationEx.restart(v.getContext());
ApplicationEx.restart(v.getContext(), "accept_unsupported");
}
});

@ -298,7 +298,7 @@ public class ApplicationEx extends Application
case "language": // misc
case "wal": // misc
// Should be excluded for import
restart(this);
restart(this, key);
break;
case "debug":
case "log_level":
@ -310,7 +310,8 @@ public class ApplicationEx extends Application
}
}
static void restart(Context context) {
static void restart(Context context, String reason) {
Log.i("Restart because " + reason);
Intent intent = new Intent(context, ActivityMain.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
context.startActivity(intent);

@ -1087,7 +1087,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override
public void onClick(View v) {
prefs.edit().remove("debug").commit();
ApplicationEx.restart(v.getContext());
ApplicationEx.restart(v.getContext(), "query_threads");
}
});
@ -1119,7 +1119,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
.putBoolean("sqlite_auto_vacuum", checked)
.remove("debug")
.apply();
ApplicationEx.restart(v.getContext());
ApplicationEx.restart(v.getContext(), "sqlite_auto_vacuum");
}
});
@ -1144,7 +1144,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override
public void onClick(View v) {
prefs.edit().remove("debug").commit();
ApplicationEx.restart(v.getContext());
ApplicationEx.restart(v.getContext(), "sqlite_cache");
}
});

Loading…
Cancel
Save