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 @Override
public void onClick(View v) { public void onClick(View v) {
prefs.edit().putBoolean("accept_unsupported", true).commit(); 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 "language": // misc
case "wal": // misc case "wal": // misc
// Should be excluded for import // Should be excluded for import
restart(this); restart(this, key);
break; break;
case "debug": case "debug":
case "log_level": 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 intent = new Intent(context, ActivityMain.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
context.startActivity(intent); context.startActivity(intent);

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

Loading…
Cancel
Save