1.17 霍尼韦尔EDA51、EDA50P,调用扫描枪的方法,在关闭的时候停止调用扫描枪
This commit is contained in:
@ -11,7 +11,7 @@ android {
|
||||
minSdk 28
|
||||
targetSdk 28
|
||||
versionCode 1
|
||||
versionName "1.16"
|
||||
versionName "1.17"
|
||||
|
||||
// 1.0 IDATA广播模式处理
|
||||
// 1.1 霍尼韦尔的监听修改(扫描网站二维码跳出程序,监听失效,调整)、斑马PDA广播模式设置
|
||||
@ -30,6 +30,7 @@ android {
|
||||
// 1.14 瑞芯 rk3566_r 添加引用 librockchip.so; 新加一个方法,返回当前PDA的厂家和型号
|
||||
// 1.15 系统状态栏根据配置进行设置
|
||||
// 1.16 idata pda 不设置模式
|
||||
// 1.17 霍尼韦尔EDA51、EDA50P,调用扫描枪的方法,在关闭的时候停止调用扫描枪
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a'
|
||||
|
||||
@ -57,7 +57,8 @@ public class ScanServiceEDA50P extends Service
|
||||
super.onCreate();
|
||||
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
NotificationChannel channel = null;
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { //适配9.0service
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { //适配9.0service
|
||||
// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { //适配9.0service
|
||||
channel = new NotificationChannel(notificationId, notificationName, NotificationManager.IMPORTANCE_HIGH);
|
||||
notificationManager.createNotificationChannel(channel);
|
||||
Notification notification = new Notification.Builder(getApplicationContext(), notificationId).build();
|
||||
@ -78,9 +79,11 @@ public class ScanServiceEDA50P extends Service
|
||||
//Service被关闭之前回调
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
Log.i(TAG, "onDestory方法被调用!");
|
||||
Log.i(TAG, "onDestroy方法被调用!");
|
||||
super.onDestroy();
|
||||
|
||||
if (mBarcodeReader != null) {
|
||||
mBarcodeReader.release();
|
||||
}
|
||||
if (this.mInternalScannerReader != null) {
|
||||
this.mInternalScannerReader.removeBarcodeListener(this);
|
||||
this.mInternalScannerReader.removeTriggerListener(this);
|
||||
|
||||
Reference in New Issue
Block a user