PlayerIO

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

Android Client Reference

Android  class documentationClass CallbackRegistration<T>

Namespace: com.playerio
Language: Java

A generic callback adapter for methods returning registration errors.

This class is identical to the Callback class, except it is used for asynchronous methods that return a PlayerIORegistrationError instead of the regular PlayerIOError in case of error. Consequently, the argument to the onError method is of that type.

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

Methods

 
public void
onError (PlayerIORegistrationError error)

If an error occurred for your method call, this method will be called with the error. You should override this method if you want to perform any action when an error happens, for example alerting the user or logging the error, etc.

public void
onSuccess (T result)

If the method call is a success, this method will be called with whatever the results were for that call. You should override this method if you want to handle the success case.

CallbackRegistration<T>.onError

public void
onError (PlayerIORegistrationError error)

If an error occurred for your method call, this method will be called with the error. You should override this method if you want to perform any action when an error happens, for example alerting the user or logging the error, etc.

Arguments

PlayerIORegistrationError error

CallbackRegistration<T>.onSuccess

public void
onSuccess (T result)

If the method call is a success, this method will be called with whatever the results were for that call. You should override this method if you want to handle the success case.

Arguments

T result