Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainActivity extends AppCompatActivity {
- String startTime = "";
- String endTime = "";
- ....
- ....
- ....
- public void dailyHours(){
- //Retrieve clockInId (ObjectID for clockInTime)
- ParseQuery<ParseObject> startQuery = ParseQuery.getQuery("clockIn");
- startQuery.getInBackground(clockInId, new GetCallback<ParseObject>() {
- public void done(ParseObject clockIn, ParseException e) {
- if (e == null) {
- startTime = clockIn.getString("Time");
- Log.d(TAG, "StartTime: " + startTime);
- } else {
- // something went wrong
- }
- }
- });
- //Retrieve clockOutId (ObjectID for clockOutTime)
- ParseQuery<ParseObject> endQuery = ParseQuery.getQuery("clockOut");
- endQuery.getInBackground(clockOutId, new GetCallback<ParseObject>() {
- public void done(ParseObject clockOut, ParseException e) {
- if (e == null) {
- endTime = clockOut.getString("Time");
- Log.d(TAG, "EndTime: " + endTime);
- } else {
- // something went wrong
- }
- }
- });
- public void dailyHours(){
- //Retrieve clockInId (ObjectID for clockInTime)
- ParseQuery<ParseObject> startQuery = ParseQuery.getQuery("clockIn");
- startQuery.getInBackground(clockInId, new GetCallback<ParseObject>() {
- public void done(ParseObject clockIn, ParseException e) {
- if (e == null) {
- startTime = clockIn.getString("Time");
- } else {
- // something went wrong
- }
- }
- });
- Log.d(TAG, "StartTime: " + startTime); //startTime returns an empty string when moved here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement