public void onDestroy() { MsrInterface.cancelPoll(); isPollCanceled = true; MsrInterface.close(); if (null != waitDataLooper) { waitDataLooper.quit(); } }
public void onStart() { if (MsrInterface.open() < 0) { MsrInterface.close(); MsrInterface.open(); } Handler handler = new Handler(waitDataLooper); handler.post( new Runnable() { @Override public void run() { int timeout = 300000; gotoPoll(timeout); } }); }