title: Android: Using Parse to update Object
body: <p>I am trying to create an application which will change the object:status of Class:attendance, from 1 to 0 and vice versa via 2 buttons (start &amp; stop). </p>
  
  <p>The change will then be read by another device to check the attendance. (not impt to the question but might be useful)</p>
  
  <p>I tried to search for tutorials or samples or video but couldn't do it. Can someone help me on this pls?</p>
  
  <pre><code>    startAttdBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Toast.makeText(AttendanceActivity.this, "Attendance taking starts now. Click STOP to end session.", Toast.LENGTH_LONG).show();
  
  
              ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery("Attendance");
  
              // Retrieve the object by id
              query.getInBackground("v4nWkoFlmZ", new GetCallback&lt;ParseObject&gt;() {  //retrieve serverID instead of object from parse
                  public void done(ParseObject Attendance, ParseException e) {
                      if (e == null) {
  
                          Attendance.put("Status", 1);
                          Attendance.saveInBackground();
                      }
                  }
  
                  @Override
                  public void done(ParseObject parseObject, com.parse.ParseException e) {
  
                  }
  
              });
          }
      });
  
      stopAttdBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Toast.makeText(AttendanceActivity.this, "Attendance taking ended. Please wait...", Toast.LENGTH_LONG).show();
              ParseObject attendance = new ParseObject("Attendance");
              attendance.put("Status", 0);
              attendance.saveInBackground();
              //startActivity(intentAttdResult);
          }
      });
  </code></pre>