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

Apps Accessing and intent from a Service?

aryaxt

Newbie
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:
public void socketGotMessage(String message)
{
     if (message == "chat")
     {
            Activity myTopActivity = //somehow get the top activity
            myTopActivity.displayChatMessage("You got a message");
     }
}
 
Back
Top Bottom