Google Game Services GamesClient构造函数undefined,Android

时间:2013-08-18 08:08:45

标签: android service constructor

我在设置Google Play游戏服务的GamesClient对象时遇到了问题。

所以我有我的主要活动,它扩展了BaseGameUtilities。 在onCreate()方法中,我尝试设置我的GamesClient

GamesClient.Builder gameClientBuilder = new GamesClient.Builder(getBaseContext(), this, this);

在Eclipse中我得到错误:“构造函数GamesClient.Builder(Context,MainActivity,MainActivity)未定义”

我也尝试过以下调用但没有成功:

 GamesClient.Builder gameClientBuilder = new GamesClient.Builder(this, this, this);

GamesClient gameClient = new GamesClient.Builder(getBaseContext(), this, this).create();  

GamesClient gameClient = new GamesClient(getBaseContext(), this, this).create();  

我不确定这是否是由于我在调用它的地方,或者与我如何调用它有关。任何帮助非常感谢!

干杯

1 个答案:

答案 0 :(得分:0)

假设您已经实现了回调所需的方法,则必须执行此类GamesClient GamesClient gc = (new GamesClient.Builder(getBaseContext(), this, this)).create();