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 Getting Data from the Web Moving Work from the Main Thread to an AsyncTask

Declare the 'doInBackground(Object... params)'

I need to declair an protected doInBackground string and return an empty string. Below my code

3 Answers

Paul Stevens
Paul Stevens
4,125 Points

Hello,

For part one of this challenge I have the following code:

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

}

For part two of this challenge I have this:

private class   CustomAsyncTask extends AsyncTask<Object, Void, String>{
            @Override
        protected String doInBackground(Object... params) {

            return "";
        }  
    }

These pieces of code both work as I tried them, although I did have to watch the video again to get it right :D

Hope this helps,

Paul :)

Paul, Thanks you verry much, I was almost there but sturggle to return a empty string. I saw in your code return """; It makes sense that this make the empty return.

Again: Thank you verry much

Here I'm getting stuck:

private class CustomAsyncTask extends AsyncTask<Object, Void, String> { protected String doInBackground(Object... arg0) {

}