【发布时间】:2017-02-12 13:33:00
【问题描述】:
我尝试在我的游戏中实现 Game Play Service 成就,但是当成就解锁时,它不会弹出(显示成就已解锁)但是当我打开所有成就列表时它显示已解锁。所以我的问题是,解锁后如何弹出成就?
MainActivity.class
public static GoogleApiClient mGoogleApiClient;
private void callGooglePlay(){
mGoogleApiClient = new GoogleApiClient.Builder(getApplicationContext())
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Games.API).addScope(Games.SCOPE_GAMES)
.build();
}
PlayActivity.class
Games.Achievements.unlock(MainMenu.mGoogleApiClient, getResources().getString(R.string.e));
【问题讨论】:
-
你在 UIThread 上运行它吗?
-
另外,弹窗仅在您第一次解锁时出现,它是基于云的,您需要在 Play Games Console 服务器端重置它。
-
是的,它在 UIThread 上运行。即使第一次解锁也完全不会出现。
标签: android google-play-games achievements