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


Sara Nocentini
Sara Nocentini
1,157 Points

Help, CodeChallenge Stage 4, task 2

Hi, I get this error and I don't know why: Bummer! Make sure you set the 'mStatus' label using the 'result' variable passed into the 'onPostExecute()' method.

The task is the following: Inside 'onPostExecute()', set the member variable 'mStatus' to the value passed into 'onPostExecute()'. Then call the 'updateStatusLabel()' method of 'CustomActivity'.

and my answer:

import android.os.AsyncTask;
import android.os.Bundle;

public class CustomActivity extends Activity {
    public String mStatus;

        public void onCreate(Bundle savedInstanceState) {
        CustomAsyncTask task = new CustomAsyncTask();

    protected void updateStatusLabel() {

    protected class CustomAsyncTask extends AsyncTask<Object, Void, String> {   

    protected void onPostExecute(String result) {
            mStatus = result;


Sara Nocentini
Sara Nocentini
1,157 Points

Sorry I don't know how to copy it without loosing the format.

1 Answer