if (mClientThread != null) {
mClientThread.interrupt();
(new Thread() {
@Override
public void run() {
try {
mClientThread.join();
mClientThread = null;
} catch (InterruptedException e) {
Log.w(TAG, "Interrupted while waiting for thread to join");
}
}
}).run();
}