emdkManager - put to other intent

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!