Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Blog Reader Android App Adapting Data for Display in a List Finishing Our AsyncTask

Stage 4: Finishing Our AsyncTask - @Override error upon creating OnPostExecute method

Using Android Studio and a Samsung T-211, get following Gradle Build message:

Error:(140, 9) method does not override or implement a method from a supertype

when creating

@Override protected void OnPostExecute(JSONObject result){ mBlogData = result; updateList();

    }

Removing @Override removed error but project compiles without getting JSON data. Logcat just returns:

09-01 21:38:54.531 26915-26915/com.thetechguys.blogreader D/dalvikvm﹕ Late-enabling CheckJNI 09-01 21:38:55.140 26915-26915/com.thetechguys.blogreader D/AbsListView﹕ Get MotionRecognitionManager 09-01 21:38:55.390 26915-26915/com.thetechguys.blogreader D/libEGL﹕ loaded /system/lib/egl/libEGL_MRVL.so 09-01 21:38:55.437 26915-26915/com.thetechguys.blogreader D/libEGL﹕ loaded /system/lib/egl/libGLESv1_CM_MRVL.so 09-01 21:38:55.453 26915-26915/com.thetechguys.blogreader D/libEGL﹕ loaded /system/lib/egl/libGLESv2_MRVL.so 09-01 21:38:55.515 26915-26915/com.thetechguys.blogreader D/GC﹕ <tid=26915> OES20 ===> GC Version : GC Ver-988-JB-R4-RC2-GC26 09-01 21:38:55.539 26915-26915/com.thetechguys.blogreader D/OpenGLRenderer﹕ Enabling debug mode 0

1 Answer

Evan Anger
STAFF
Evan Anger
Treehouse Guest Teacher

Make sure your onPostExecute is part of an actual AsyncTask class. Im guessing in your case the onPostExecute is setup as a method inside an activity or fragment, so thats why its complaining about the override. There isnt an override in activity or fragment, so when you remove that annotation you get a clean compile, but you arent wiring up the code as it was intended.

Try double checking that and let us know.

I honestly don't know what happened here, somehow the line onPostExecute would evaluate to onPostexecute when copied to the clipboard but would show up as OnPostExecute within the IDE editor. Had to to delete whole AsyncTask and start over.