Profile

Cover photo
Jim Jeffers
Works at Sumo Creations LLC
Attended HPI d.school
Lives in Portland, OR
268 followers|14,034 views
AboutPostsPhotosYouTube

Stream

Jim Jeffers

Bug Reports  - 
 
Hey there,

I have an AsyncTask that now hangs when I update my app to use Google Play services 7.8.0. The code was working without issue when my app was using 7.5.0. Any idea what might cause this to occur?

  private class QueryDataTask extends AsyncTask<Void, Void, DataReadResult> {
       @Override
        protected void onPreExecute() {
            super.onPreExecute();
            Log.d(TAG, "Executing query task");
        }

        protected DataReadResult doInBackground(Void... params) {
            Calendar date = new GregorianCalendar();
            date.set(Calendar.HOUR_OF_DAY, 0);
            date.set(Calendar.MINUTE, 0);
            date.set(Calendar.SECOND, 0);
            date.set(Calendar.MILLISECOND, 0);
            date.add(Calendar.DAY_OF_MONTH, 1);
            date.add(Calendar.SECOND, -1);
            long endTime = date.getTimeInMillis();

            date.add(Calendar.DAY_OF_MONTH, -15);
            long startTime = date.getTimeInMillis();

            DataReadRequest readRequest = new DataReadRequest.Builder()
              .aggregate(DataType.TYPE_STEP_COUNT_DELTA, DataType.AGGREGATE_STEP_COUNT_DELTA)
              .bucketByTime(1, TimeUnit.DAYS)
              .setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS)
              .build();
              
            Log.d(TAG, "Sending Google Fit Task");
            return Fitness.HistoryApi.readData(mClient, readRequest).await(1, TimeUnit.MINUTES);
        }

       @Override
        protected void onPostExecute(DataReadResult dataReadResult) {
            Log.d(TAG, "Post Execute Google Fit Task");
        }
    }
1
Ian Lake's profile photoJim Jeffers's profile photo
4 comments
 
+Ian Lake Using setResultCallback() resolved the issue.
Add a comment...
Have him in circles
268 people
jeremie lederman's profile photo
Eric Hillenbrand's profile photo
David Funk's profile photo
Jimmy Ti's profile photo
Rick McCartney's profile photo
ashfak-ul- aziz's profile photo
Kevin Johnston's profile photo
Ryan Jamieson's profile photo
Dhvani Sharma's profile photo
People
Have him in circles
268 people
jeremie lederman's profile photo
Eric Hillenbrand's profile photo
David Funk's profile photo
Jimmy Ti's profile photo
Rick McCartney's profile photo
ashfak-ul- aziz's profile photo
Kevin Johnston's profile photo
Ryan Jamieson's profile photo
Dhvani Sharma's profile photo
Collections Jim is following
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Portland, OR
Previously
Berlin, Germany - Brisbane, Australia - Phoenix, AZ - Chicago, IL
Links
Work
Occupation
Designing & Programming
Employment
  • Sumo Creations LLC
    Lead Creative, 2006 - present
Education
  • HPI d.school
    Design Thinking, 2010 - 2011
  • University of Queensland
    Masters of Interaction Design, 2009 - 2010
  • Arizona State University
    Bachelors of Business / Marketing & Minor in Communications, 2002 - 2006
Basic Information
Gender
Male