Skip to content

Commit

Permalink
修警告
Browse files Browse the repository at this point in the history
  • Loading branch information
kadbbz committed Aug 2, 2024
1 parent cabe202 commit 5b6dedb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.elvishew.xlog.XLog;
import com.hjq.permissions.Permission;
import com.huozige.lab.container.BaseActivity;
import com.huozige.lab.container.R;
import com.huozige.lab.container.proxy.support.BaseActivityNoActionBar;
import com.huozige.lab.container.utilities.DeviceUtilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import android.widget.ProgressBar;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.elvishew.xlog.XLog;
import com.github.barteksc.pdfviewer.PDFView;
import com.huozige.lab.container.BaseActivity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.elvishew.xlog.XLog;
import com.huozige.lab.container.BaseActivity;
import com.huozige.lab.container.R;
import com.huozige.lab.container.proxy.support.BaseActivityNoActionBar;
import com.huozige.lab.container.utilities.StringConvertUtility;
Expand Down Expand Up @@ -41,7 +38,7 @@ public class BleProxy_ReadingActivity extends BaseActivityNoActionBar {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

helper= BleHelper.getInstance(getApplication());
helper = BleHelper.getInstance(getApplication());

setContentView(R.layout.activity_ble_proxy_reading);
findViewById(R.id.button_cancel).setOnClickListener(_cancelButtonClick);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
import android.nfc.Tag;
import android.os.Bundle;
import android.os.Parcelable;

import com.elvishew.xlog.XLog;

import android.view.View;
import android.widget.Toast;

import com.huozige.lab.container.BaseActivity;
import com.elvishew.xlog.XLog;
import com.huozige.lab.container.R;
import com.huozige.lab.container.proxy.support.BaseActivityNoActionBar;

Expand Down Expand Up @@ -114,7 +111,8 @@ protected void onNewIntent(Intent intent) {
XLog.v("扫描到NFC标签,即将读取");
Intent data = getIntent();
Tag tag = data.getParcelableExtra(NfcAdapter.EXTRA_TAG);
String tagInHex = bytesToHex(tag.getId());

String tagInHex = (tag != null) ? bytesToHex(tag.getId()) : "";

XLog.v("NFC标签的TAG ID为:" + tagInHex);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import com.elvishew.xlog.XLog;
import android.view.View;

import com.huozige.lab.container.BaseActivity;
import com.elvishew.xlog.XLog;
import com.huozige.lab.container.R;
import com.huozige.lab.container.proxy.support.BaseActivityNoActionBar;
import com.huozige.lab.container.utilities.ConfigManager;
Expand All @@ -34,7 +33,7 @@ public void onReceive(Context context, Intent intent) {
XLog.v("收到单次扫码结果的广播");

// 按照厂商的文档,从广播中获取扫码结果
String result = intent.getStringExtra( (null == ConfigManager.getInstance().getScanExtra())? getString( R.string.feature_scanner_extra_key_barcode_broadcast):ConfigManager.getInstance().getScanExtra());
String result = intent.getStringExtra((null == ConfigManager.getInstance().getScanExtra()) ? getString(R.string.feature_scanner_extra_key_barcode_broadcast) : ConfigManager.getInstance().getScanExtra());

XLog.v("扫码结果是:" + result);

Expand Down Expand Up @@ -80,7 +79,7 @@ public void onResume() {

super.onResume();

String intentF = (ConfigManager.getInstance().getScanAction() == null)?getString(R.string.feature_scanner_broadcast_name):ConfigManager.getInstance().getScanAction();
String intentF = (ConfigManager.getInstance().getScanAction() == null) ? getString(R.string.feature_scanner_broadcast_name) : ConfigManager.getInstance().getScanAction();

// 按照名称来过滤出需要处理的广播
IntentFilter intentFilter = new IntentFilter(intentF);
Expand Down

0 comments on commit 5b6dedb

Please sign in to comment.