1
저장 및 데이터로드를 위해 Cloud를 사용하기 위해 AppStateClient를 초기화해야합니다. 나는 다음을 수행한다 :안드로이드에서 Cloud Save를 사용할 때 NullPointerException이 발생했습니다.
public Constructor() {
(1) private GameHelper aHelper = new GameHelper(this);
(2) aHelper.setup(this, GameHelper.CLIENT_APPSTATE | GameHelper.CLIENT_GAMES);
(3) private AppStateClient mHelper = aHelper.getAppStateClient();
}
그러나 두 번째 문자열에는 항상 NullPointerException이있다. Goggle의 GameHelper 수업에서 다음과 같이 충돌합니다.
mGamesClient = new GamesClient.Builder(getContext(), this, this)
.setGravityForPopups(Gravity.TOP | Gravity.CENTER_HORIZONTAL)
.setScopes(mScopes)
.create();
and on:
mAppStateClient = new AppStateClient.Builder(getContext(), this, this)
.setScopes(mScopes)
.create();
내가 뭘 잘못 했습니까?
변수 내 앱에서 성과 및 리더 보드를 사용하여 모든 작업이 정상적으로 작동합니다.
당신이 그것을 디버깅을 시도 해 봤나 클래스 대신 생성자에서 onCreate (번들 savedInstanceState)에 전화를해야합니까? – Slim