Skip to content

Commit

Permalink
实现重启软件方法
Browse files Browse the repository at this point in the history
Signed-off-by: Lin <[email protected]>
  • Loading branch information
Lin committed Nov 27, 2023
1 parent 25d30b9 commit 379758a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
Expand All @@ -14,6 +15,7 @@
import androidx.appcompat.widget.Toolbar;

import org.autojs.autojs.ui.BaseActivity;
import org.autojs.autojs.ui.main.MainActivity;
import org.autojs.autoxjs.BuildConfig;
import org.autojs.autoxjs.R;

Expand Down Expand Up @@ -96,8 +98,10 @@ private void setUpUI() {
});

restartButton.setOnClickListener(view -> {
// TODO 等待处理
Toast.makeText(ErrorReportActivity.this, "功能未实现", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish(); // 关闭当前 Activity
});

exitButton.setOnClickListener(view -> exit());
Expand Down

0 comments on commit 379758a

Please sign in to comment.