TC56 infrared scanner not working on logout from android app

i ibrahim nehme 3 years 7 months ago
17 0 0

I am using the code below to logout user from app and sent them to sign in activity. Infrared scanner not working in sign in activity after logout method. The logout method is in a BaseActivity class where other activity inherit the BaseActivity and use the logout method. Any help is greatly appreciated.

Below the logout code: (logout method is generic and it can be called from any activity)
------------------
Intent intent = new Intent(mContext, SignInActivity.class);
intent.putExtra("finish", true);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
  Intent.FLAG_ACTIVITY_CLEAR_TASK |
  Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
finish();

code in sign in activity:
------------------------------
@Overridepublic void onStop() {
   super.onStop();  
  BarcodeScanner.deInitScanner();
  BarcodeScanner.releaseEmdk(); 
}

@Overrideprotected void onDestroy() {
   // TODO Auto-generated method stub   super.onDestroy();
   if (BuildConfig.DEVICE_TYPE.equals(Constants.DEVICE_TYPE)) {
  BarcodeScanner.releaseEmdk();
  }
}

@Overrideprotected void onResume()
{
   super.onResume();
   if (BuildConfig.DEVICE_TYPE.equals(Constants.DEVICE_TYPE)) {
  BarcodeScanner.getInstance(this);
  BarcodeScanner.registerUIobject(this);
  }
}

@Overrideprotected void onPause() {
   // TODO Auto-generated method stub   super.onPause();
   if (BuildConfig.DEVICE_TYPE.equals(Constants.DEVICE_TYPE)) {
  BarcodeScanner.unregisterUIobject();
  }
}

CONTACT
Can’t find what you’re looking for?