0
我想獲得scoreloop中當前用戶的分數。但我不知道邏輯如何。scoreloop獲得當前用戶不工作的分數
我想:
scoresController.setRangeLength(1);
scoresController.loadRangeForUser(Session.getCurrentSession().getUser());
但沒有獲得當前用戶。它返回了其他人。因爲我undestand setRangeLength返回我需要的用戶數和loadRangeForUser是我把用戶ID。
//Score for single user
final RequestControllerObserver observer2 = new RequestControllerObserver() {
public void requestControllerDidReceiveResponse(final RequestController requestController) {
// get the scores from our controller
ScoresController scoresController = (ScoresController) requestController;
List<Score> scores = scoresController.getScores();
if(scores!=null){
for (Score score2 : scores) {
PointsText.setText(" "+ScoreFormatter.format(score2));
RankText.setText(" "+score2.getRank());
}
// we're done!
dismissDialog(DIALOG_PROGRESS);
}
}
public void requestControllerDidFail(final RequestController aRequestController, final Exception anException) {
dismissDialog(DIALOG_PROGRESS);
}
};
// set up a ScoresController with our observer
ScoresController scoresController = new ScoresController(null,observer2);
showDialog(DIALOG_PROGRESS);
scoresController.setMode(0);
scoresController.setRangeLength(1);
scoresController.loadRangeForUser(Session.getCurrentSession().getUser());
}