Profile

Cover photo
Jim Jeffers
Works at Sumo Creations LLC
Attended HPI d.school
Lives in Portland, OR
265 followers|8,824 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...
In his circles
140 people
Have him in circles
265 people
Ted Cook's profile photo
Aaron Shuster's profile photo
David Funk's profile photo
monita kumari's profile photo
Tech 49's profile photo
Chris Colborne's profile photo
Chuck Reynolds's profile photo
vlademir ferreira de souza (Vlade)'s profile photo
Jim Jeffers's profile photo
People
In his circles
140 people
Have him in circles
265 people
Ted Cook's profile photo
Aaron Shuster's profile photo
David Funk's profile photo
monita kumari's profile photo
Tech 49's profile photo
Chris Colborne's profile photo
Chuck Reynolds's profile photo
vlademir ferreira de souza (Vlade)'s profile photo
Jim Jeffers'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