How to use Handler ?????


Last Updated:

  1. aryaxt

    aryaxt Member This Topic's Starter

    Joined:
    Jun 1, 2010
    Messages:
    21
    Likes Received:
    0
    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 (Text):
    1. //this method is in my service
    2. //it gets called when i get new messages
    3. {
    4.      MyListViewActivity activity = (MyListViewActivity) this.topActivity;
    5.      activity.updateListViewWithData(message);
    6.      //this function works only if i call it inside the activity
    7. }
     

    Advertisement

Share This Page

Loading...