• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to use Handler ?????

aryaxt

Newbie
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)
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
}
 
Back
Top Bottom