|
@@ -4,6 +4,7 @@ import android.app.AlarmManager;
|
|
|
import android.app.PendingIntent;
|
|
|
import android.content.BroadcastReceiver;
|
|
|
import android.content.Context;
|
|
|
+import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.content.IntentFilter;
|
|
|
import android.graphics.drawable.Drawable;
|
|
@@ -14,13 +15,16 @@ import android.os.CountDownTimer;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Message;
|
|
|
import android.provider.Settings;
|
|
|
+import android.support.v7.app.AlertDialog;
|
|
|
import android.support.v7.widget.CardView;
|
|
|
import android.support.v7.widget.DefaultItemAnimator;
|
|
|
import android.support.v7.widget.GridLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
+import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
+import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
@@ -1859,7 +1863,31 @@ public class CallingDoorActivity extends BaseActivity implements SerialPortUtil.
|
|
|
@Override
|
|
|
public void onClickButtonThree() {
|
|
|
super.onClickButtonThree();
|
|
|
- startActivity(new Intent(Settings.ACTION_INTERNAL_STORAGE_SETTINGS));
|
|
|
+
|
|
|
+ View dialogView = View.inflate(context, R.layout.dialog_error_log, null);
|
|
|
+ final EditText pwd = dialogView.findViewById(R.id.edit_password);
|
|
|
+ AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
|
|
+ builder.setTitle("查询异常日志");
|
|
|
+ builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ String password = pwd.getText().toString().trim();
|
|
|
+ if (TextUtils.isEmpty(password)) {
|
|
|
+ ToastUtil.showToast("密码不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (password.equals(TimeUtil.getPassWord())) {
|
|
|
+ startActivity(new Intent(Settings.ACTION_INTERNAL_STORAGE_SETTINGS));
|
|
|
+ } else {
|
|
|
+ ToastUtil.showToast("密码错误");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ AlertDialog pwdDialog = builder.create();
|
|
|
+ pwdDialog.setView(dialogView);
|
|
|
+ pwdDialog.show();
|
|
|
}
|
|
|
|
|
|
/**
|