Accessing and intent from a Service?


Last Updated:

  1. aryaxt

    aryaxt Member This Topic's Starter

    Joined:
    Jun 1, 2010
    Messages:
    21
    Likes Received:
    0
    I have a service running in the background. (A socket class)
    When the socket receives message i need to access the Activity that is shown on the screen and update the gui, any idea how i can manage to get the Activity shown to the user?
    Thanks.
    Code (Text):
    1. public void socketGotMessage(String message)
    2. {
    3.      if (message == "chat")
    4.      {
    5.             Activity myTopActivity = //somehow get the top activity
    6.             myTopActivity.displayChatMessage("You got a message");
    7.      }
    8. }
     

    Advertisement

Share This Page

Loading...