Hi all, I have doubt on thread Life cycle in android.This is my scenario I have downloaded data from web and stored it in the DB.all this activity i have done using thread,once the activity finished i passed the object to handler and proceed . But my doubt is whether i need to stop the thread?
This is the Example
showDialog(0);
Thread t=new Thread()
{
public void run()
{
downloadFromNet();
}
};
t.start();
void downloadFromNet()
{
Message myMessage=new Message();
myMessage.obj="SUCCESS";
handler.sendMessage(myMessage);
}
private Handler handler = new Handler()
{
@Override
public void handleMessage(Message msg) {
String loginmsg=(String)msg.obj;
if(loginmsg.equals("SUCCESS"))
{
removeDialog(0);
}
};
Should I need to stop the Thread or Its lifecycle will be over?