1.17 霍尼韦尔EDA51、EDA50P,调用扫描枪的方法,在关闭的时候停止调用扫描枪
This commit is contained in:
@ -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