I have read many answers, the proper way may be setting a flag in while loop, when flag become false the thread will stop.
public void run() {
// TODO Auto-generated method stub
while(flag){
doSomething...
}
}
But here I have a http request wrapped in the run method, there is no such while loop in my code, how to stop it properly, is it ok if I only stop the thread, or I have to do more to stop httprequest?