dear friends,
i am using a web service to retrieve data inside a thread. so i start thread and call website in it. problem is i called service and INTERNET was present and then disconnected how can i stop that request and stop that thread in order to show message to user that there is not INTERNET coverage.
here is code of mine please help me out what should i do?
new Thread(new Runnable() {
public void run() {
while (serviceData == null) {
DalMessages dal= new DalMessages();
serviceData = dal.getInboxConversationPosts(Session_ID, PageSize, 0);
callComplete = true;
}
mHandler.post(loadActivity());
}
private Runnable loadActivity() {
return new Runnable() {
public void run() {
if(callComplete)
{
HideLoadingAnimation();
}
}
};
}
}).start();