PlayerIO

The fastest way to build online games without breaking a sweat.

Android Client Reference

Android  class documentationClass MessageListener

Namespace: com.playerio
Language: Java

A message listener

When you are using the multiplayer service and you want your client to handle messages that were sent from the server, you need to add one or more message listeners to your connection.

The easiest way to implement a listener is to use an anonymous inner class, like this:

Methods

 
public abstractvoid
onMessage (Message message)

Implement this method to handle incoming messages.

MessageListener.onMessage

public abstractvoid
onMessage (Message message)

Implement this method to handle incoming messages.

Arguments

Message message
The incoming message of the type(s) this listener listens to.