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
Ivan Rios
2,050 PointsCode challenge
Add the 'onPostExecute()' method to the AsyncTask below. Make it 'protected void' and remember that the parameter is related to the return type of 'doInBackground()'. Please help i am geting an error. protected class CustomAsyncTask extends AsyncTask<Object, Void, String> {
@Override
protected String doInBackground(Object... params) {
// Imagine this is some code to do some work
return "Done!";
}
protected void onPostExecute(String){
}
}
3 Answers
Bert Carremans
3,179 PointsHi Ivan,
you need to add @Override above the onPostExecute method and you have to define a variable as a parameter to the onPostExecute, like this
@Override
protected void onPostExecute(String result) {
}
Jack Hill
1,168 PointsIm stuck on this one too could you guys maybe help me a little more
Chiu Tong Tsang
12,165 PointsJack,
Bert's answer should be correct. What else do you need help on?
kyle rebstock
2,019 Pointskyle rebstock
2,019 PointsSo strange that everything in the world is camel cased in the language it seems, but @Override comes out of nowhere to surprise you with 10 mins of looking for that one letter case difference. That was my issue anyways. I'm glad I found your answer.