title: How to retrieve data from parse.com database (Android)?
body: <p>I'm new to Android and have been trying to use Parse.com. The code snippets provided on their website have been very useful. I've been able to send the data from my app to database, which means that it is connecting to the right database. But I'm unable to retrieve the correct data from it. No matter what object ID I use, it always returns either null or 0 (depending on if its a string or integer). My code is as follows :</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
  
  
      TextView tv;
      Button b;
      String playerName;
      ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery("GameScore");
      //int score;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.activity_main);
          tv=(TextView) findViewById (R.id.tv);
          b=(Button) findViewById (R.id.button1);
          Parse.initialize(this, "n12BWwZwk*************3dyKnuIUU", "vVi4TwI***************4peRD1VwyJ9CHw");
          final ParseObject gameScore = new ParseObject("GameScore");
         /* gameScore.put("score", 900);
          gameScore.put("playerName", "Pranav");
          gameScore.put("cheatMode", false);
          gameScore.saveInBackground();
        */
  
  
          query.whereEqualTo("objectId", "PnfRaUtHjB");
          query.findInBackground(new FindCallback&lt;ParseObject&gt;() {
  
              @Override
              public void done(List&lt;ParseObject&gt; arg0, ParseException arg1) {
                  // TODO Auto-generated method stub
                  if (arg1==null)
                  {
                      int score=gameScore.getInt("score");
                      tv.setText("Player score - "+score);
                      Log.d("PTesting", "Player Score");
                      //Toast.makeText(getApplicationContext(), "Reached till Toast "+score,
                          //     Toast.LENGTH_LONG).show();
  
                  }
                  else
                  {
                      Log.d("score", "Error: " + arg1.getMessage());
                  }
              }
  
          });
  
  }
  }
  </code></pre>
  
  <p>I've tried using the <code>[ query.whereEqualto ]</code> with <code>playerName</code> and score too. Same results.</p>
  
  <p>I've also tried this:</p>
  
  <pre><code>ParseQuery&lt;ParseObject&gt; query=ParseQuery.getQuery("GameScore");
          query.getInBackground("YsHLfJ7tUB", new GetCallback&lt;ParseObject&gt;() {
  
              @Override
              public void done(ParseObject arg0, ParseException arg1) {
                  // TODO Auto-generated method stub
  
                  if (arg1==null)
                  {
                      int score = gameScore.getInt("score");
                      playerName = gameScore.getString("playerName");
                      boolean cheatMode = gameScore.getBoolean("cheatMode");
                      tv.setText("Updating "+playerName);
  
                  }
                  else
                  {
                      Log.d("score", "Error: " + arg1.getMessage());
                  }
              }
  </code></pre>
  
  <p>The values returned are either 0 or null.</p>
  
  <p>The database looks like this:</p>
  
  <p><a href="http://i.imgur.com/SsUO8AG.jpg" rel="nofollow">http://i.imgur.com/SsUO8AG.jpg</a></p>