From 1dcadcd12120a94bf88e4646cda0911af0ac1b59 Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Fri, 2 Aug 2024 17:06:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E8=A7=A3=E7=BB=91?= =?UTF-8?q?=E5=92=8C=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/example/bgsrfidtrack/MainActivity.java | 4 ++-- .../main/java/com/example/bgsrfidtrack/RflyActivity.java | 5 +++++ .../java/com/example/bgsrfidtrack/base/BaseActivity.java | 8 +++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/example/bgsrfidtrack/MainActivity.java b/app/src/main/java/com/example/bgsrfidtrack/MainActivity.java index 046c5a0..095854f 100644 --- a/app/src/main/java/com/example/bgsrfidtrack/MainActivity.java +++ b/app/src/main/java/com/example/bgsrfidtrack/MainActivity.java @@ -69,8 +69,8 @@ public class MainActivity extends BaseActivity { SharedPreferencesUtils.putstring("ip", ip); } - // Intent intent = new Intent(MainActivity.this, HomePageActivity.class); - Intent intent = new Intent(MainActivity.this, RflyActivity.class); + Intent intent = new Intent(MainActivity.this, HomePageActivity.class); + // Intent intent = new Intent(MainActivity.this, RflyActivity.class); // Intent intent = new Intent(MainActivity.this, WebViewActivity.class); startActivity(intent); finish(); diff --git a/app/src/main/java/com/example/bgsrfidtrack/RflyActivity.java b/app/src/main/java/com/example/bgsrfidtrack/RflyActivity.java index eb614f3..872f4d9 100644 --- a/app/src/main/java/com/example/bgsrfidtrack/RflyActivity.java +++ b/app/src/main/java/com/example/bgsrfidtrack/RflyActivity.java @@ -238,6 +238,11 @@ public class RflyActivity extends BaseActivity implements Rfly.ConnectCallback, } // 解绑 public void deleteItem(View view) { + if (!state.get()) { + Toast.makeText(context, "停止读取", Toast.LENGTH_SHORT).show(); + blueToothSanRFID(null); + } + OkGo.post("http://" + SharedPreferencesUtils.getstring("ip", "") + "/api/deleteLocationCode") .params("dbCode",binding.ledgerDb.getText().toString() ) diff --git a/app/src/main/java/com/example/bgsrfidtrack/base/BaseActivity.java b/app/src/main/java/com/example/bgsrfidtrack/base/BaseActivity.java index d0e9fdf..3d559e5 100644 --- a/app/src/main/java/com/example/bgsrfidtrack/base/BaseActivity.java +++ b/app/src/main/java/com/example/bgsrfidtrack/base/BaseActivity.java @@ -71,6 +71,11 @@ public class BaseActivity extends AppCompatActivity { } + @Override + protected void onResume() { + super.onResume(); + } + public void initRFID() { application = MyApplication.getApplication(); uhfReader = application.getUhfReader(); @@ -87,7 +92,7 @@ public class BaseActivity extends AppCompatActivity { } private void initDialog() { - dialog = new ProgressDialog(this); + dialog = new ProgressDialog(context); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setCanceledOnTouchOutside(false); dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); @@ -116,6 +121,7 @@ public class BaseActivity extends AppCompatActivity { protected void onDestroy() { super.onDestroy(); unregisterReceiver(myReceiver); + } public void titleToolClick(View view) {