I have a socket running as a service.
It receive some data , and based on this data i need to update my gui, for example populate a ListView. but it doesn't work.
How can i use a handler here?
public void socketGotData(String message)
It receive some data , and based on this data i need to update my gui, for example populate a ListView. but it doesn't work.
How can i use a handler here?
public void socketGotData(String message)
Code:
//this method is in my service
//it gets called when i get new messages
{
MyListViewActivity activity = (MyListViewActivity) this.topActivity;
activity.updateListViewWithData(message);
//this function works only if i call it inside the activity
}