java.lang.Object | |
↳ | com.google.android.gms.games.GamesClient.Builder |
Builder class for GamesClient.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new Builder object to be used to build a corresponding GamesClient object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new GamesClient object to be used to communicate with the games service,
requesting all of the scopes passed in.
| |||||||||||
Specify an account name on the device that should be used.
| |||||||||||
Specifies the part of the screen at which games service popups (for example, "welcome
back" or "achievement unlocked" popups) will be displayed using gravity.
| |||||||||||
Set the scopes to use when building the GamesClient object.
| |||||||||||
Sets the
View to use as a content view for popups. |
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a new Builder object to be used to build a corresponding GamesClient object.
context | The context to use for the connection. |
---|---|
connectedListener | The listener where the results of the asynchronous
connect() call are delivered. |
connectionFailedListener | The listener which will be notified if the connection attempt fails. |
Creates a new GamesClient object to be used to communicate with the games service, requesting all of the scopes passed in.
This method should be called fromonCreate(android.os.Bundle)
or
onActivityCreated(android.os.Bundle)
.
The object is not usable until after the asynchronous connect()
method has been
called and your listener's
onConnected(Bundle)
method is called. Note
that the ConnectionCallbacks
provided here will always receive callbacks before
any subsequently registered connection listeners.
When your application is done using this client it must call disconnect()
, even if
the async result from connect()
has not yet been delivered.
The typical pattern is to instantiate this object in your Activity's
onCreate(Bundle)
method and then call connect()
in
onStart()
and disconnect()
from onStop()
regardless
of the state.
Specify an account name on the device that should be used. If this is never called, the client will use the current default account for Google Play Games for this application.
accountName | The account name on the device that should be used by this
GamesClient . Must be non-null.
|
---|
Specifies the part of the screen at which games service popups (for example, "welcome back" or "achievement unlocked" popups) will be displayed using gravity.
Default value is TOP
|CENTER_HORIZONTAL
.
gravity | The gravity which controls the placement of games service popups. |
---|
Sets the View
to use as a content view for popups.
gamesContentView | The view to use as a content view for popups. View cannot be null. |
---|