hi mate i have a thread with this code
private final class Consumer extends Thread {
public boolean running;
public Handler consumerHandler;
public void run() {
Looper.prepare();
consumerHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
Log.i(LOG_TAG, "Consumer-> " + msg.obj);
}
};
Looper.loop();
}
}
My activity create a thread T of type Consumer and call start on it.
How can the activity stop the thread T ?
Running message loop will not normally exit the loop unless an exception is thrown or you’ve call the
quit()method. Have a look at DOC – Be sure to call quit() to end the loop.