Skip to content

Instantly share code, notes, and snippets.

@marialecodes
Created July 31, 2012 03:20
Show Gist options
  • Save marialecodes/3213218 to your computer and use it in GitHub Desktop.
Save marialecodes/3213218 to your computer and use it in GitHub Desktop.
package com.xxx;
import com.parse.CountCallback;
import com.parse.ParseException;
import com.parse.ParseQuery;
import com.parse.ParseUser;
public class ParseList {
// getGames() Busca partidas donde el "player1" sea el usuario actual.
public void getGames() {
ParseUser currentUser = ParseUser.getCurrentUser();
ParseQuery gamesQuery = new ParseQuery ("Game");
gamesQuery.whereEqualTo("player1", currentUser);
gamesQuery.countInBackground(new CountCallback() {
public void done(int count, ParseException e) {
if (e == null) {
// Se obtiene la lista de objetos "Game"
showGames(count);
}
else {
// No hay partidas
}
}
});
}
public void showGames(int count){
// ??
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment