RoomUpdateListener | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
public interface

# RoomUpdateListener

com.google.android.gms.games.multiplayer.realtime.RoomUpdateListener

## Class Overview

The listener invoked when the state of the room has changed.

## Summary

Public Methods
abstract void | onJoinedRoom(int statusCode, Room room) Called when the client attempts to join a real-time room.
abstract void | onLeftRoom(int statusCode, String roomId) Called when the client attempts to leaves the real-time room.
abstract void | onRoomConnected(int statusCode, Room room) Called when all the participants in a real-time room are fully connected.
abstract void | onRoomCreated(int statusCode, Room room) Called when the client attempts to create a real-time room.

## Public Methods

#### public abstract void onJoinedRoom (int statusCode, Room room)

Called when the client attempts to join a real-time room. The real-time room can be joined by calling the `join(GoogleApiClient, RoomConfig)` operation. Possible status codes include:

- `STATUS_OK` if data was successfully loaded and is up-to-date.
- `STATUS_CLIENT_RECONNECT_REQUIRED` if the client needs to reconnect to the service to access this data.
- `STATUS_REAL_TIME_CONNECTION_FAILED` if the client failed to connect to the network
- `STATUS_MULTIPLAYER_DISABLED` if the game does not support multiplayer.
- `STATUS_INTERNAL_ERROR` if an unexpected error occurred in the service.

##### Parameters

statusCode | A status code indicating the result of the operation.
room | The data of the room that was joined. The room can be `null` if the `join(GoogleApiClient, RoomConfig)` operation failed.

#### public abstract void onLeftRoom (int statusCode, String roomId)

Called when the client attempts to leaves the real-time room. Possible status codes include:

- `STATUS_OK` if operation was successfully completed.
- `STATUS_INTERNAL_ERROR` if an unexpected error occurred in the service.

##### Parameters

statusCode | A status code indicating the result of the operation.
roomId | ID of the real-time room which was left.

#### public abstract void onRoomConnected (int statusCode, Room room)

Called when all the participants in a real-time room are fully connected. This gets called once all invitations are accepted and any necessary automatching has been completed. Possible status codes include:

- `STATUS_OK` if data was successfully loaded and is up-to-date.
- `STATUS_CLIENT_RECONNECT_REQUIRED` if the client needs to reconnect to the service to access this data.
- `STATUS_INTERNAL_ERROR` if an unexpected error occurred in the service.

##### Parameters

room | The fully connected room object. The room can be `null` if it could not be loaded successfully.

#### public abstract void onRoomCreated (int statusCode, Room room)

Called when the client attempts to create a real-time room. The real-time room can be created by calling the `create(GoogleApiClient, RoomConfig)` operation. Possible status codes include:

- `STATUS_OK` if data was successfully loaded and is up-to-date.
- `STATUS_CLIENT_RECONNECT_REQUIRED` if the client needs to reconnect to the service to access this data.
- `STATUS_REAL_TIME_CONNECTION_FAILED` if the client failed to connect to the network
- `STATUS_MULTIPLAYER_DISABLED` if the game does not support multiplayer.
- `STATUS_INTERNAL_ERROR` if an unexpected error occurred in the service.

##### Parameters

statusCode | A status code indicating the result of the operation.
room | The room data that was created if successful. The room can be `null` if the `create(GoogleApiClient, RoomConfig)` operation failed.