emdkManager - put to other intent

// Expert user has replied.
A Alexey Titov 3 years 6 months ago
26 1 0

Hi!
I have an application in which one activity launches other (startActivity (intent);). The scanner is used in both, and I have to use onPause and onResume for CleanUp and Initialize EMDK Objects when activity switches.
@Override
protected void onPause() {
super.onPause();
deInitScanner();
if (barcodeManager != null)
barcodeManager = null;
if (emdkManager != null) {
emdkManager.release();
emdkManager = null;
}
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
if (emdkManager == null) {
EMDKResults results = EMDKManager.getEMDKManager(getApplicationContext(), this);
if (results.statusCode != EMDKResults.STATUS_CODE.SUCCESS) {
Toast.makeText(InReturnGDSListActivity.this,
"EMDKManager Error!!!",
Toast.LENGTH_SHORT).show();
}
}
}
It is very slow. Can anyone suggest a better solution?
Thank you!

Please Register or Login to post a reply

1 Replies

K Kanagal Raj Ramaswamy

Instead of onResume, call the getEMDKManager in onCreate(). After calling getEMDKManager, do not block the main thread and call emdkManager.release() in onDestroy()

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