Skip to content

Commit

Permalink
Restart only if the options change
Browse files Browse the repository at this point in the history
  • Loading branch information
Chipppppppppp committed Feb 19, 2024
1 parent e1fef68 commit 86b8d98
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/src/main/java/io/github/chipppppppppp/lime/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,16 @@ else if (name == "open_in_browser") {
builder.setPositiveButton(context.getString(R.string.positive), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(context.getApplicationContext(), context.getString(R.string.restarting), Toast.LENGTH_SHORT).show();
Process.killProcess(Process.myPid());
context.startActivity(new Intent().setClassName(PACKAGE, "jp.naver.line.android.activity.SplashActivity"));
boolean optionChanged = false;
for (LimeOptions.Option option : limeOptions.options) {
if (option.checked != prefs.getBoolean(option.name, option.checked)) optionChanged = true;
}

if (optionChanged) {
Toast.makeText(context.getApplicationContext(), context.getString(R.string.restarting), Toast.LENGTH_SHORT).show();
Process.killProcess(Process.myPid());
context.startActivity(new Intent().setClassName(PACKAGE, "jp.naver.line.android.activity.SplashActivity"));
}
}
});

Expand Down

0 comments on commit 86b8d98

Please sign in to comment.