instead
private long getScoreLeaderBoard(String idLeaderBoard) { }
do it
private void requestScoreLeaderBoardUpdate(String idLeaderBoard) { }
and put the code that handled the getScoreLeaderBoard return value into (or called its method) onSuccess.
This way you do not need to wait and block the thread.
You can also allow their implementation to realize Leaderboard.GetUserScoreCBand then use a different method onCreate, onClick....
class MyActivity extends Activity implements Leaderboard.GetUserScoreCB {
private void requestScoreLeaderBoardUpdate(String idLeaderBoard) {
l.getUserScore(OpenFeint.getCurrentUser(), this );
}
@Override
public void onSuccess(Score score) {
s[0] = score;
}
}
source
share