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
sentry
3,499 PointsHelp proofreading this code for errors would be much appreciated!
Hi there,
I too, am currently going through the "Build a Blog Reader app" course and I've currently run into a few errors that as far as I can tell, shouldn't really exist but perhaps I'm overlooking something.
The full source is temporarily stored at https://github.com/Sentryism/temprepo/blob/master/MainListActivity.java
In particular, the errors are the following:
Android Studio tells me that GetBlogPostsTasks is an invalid symbol despite it being valid earlier and as such, renders .execute invalid as well.
if (isNetworkAvailable()) {
GetBlogPostsTask getBlogPostsTask = new GetBlogPostsTask();
getBlogPostsTask.execute();
}
Here I am told that private is an invalid modifier (but I just can't not have one... right?)
private class GetBlogPostsTask extends AsyncTask<Object, Void, JSONObject>
Lastly, with this snippet, I am told Method does not override method from its superclass.
@Override
protected void OnPostExecute(JSONObject result) {
mHCCData = result;
updateList();
I downloaded the project files (although they are from the end of the stage instead of in sync with the video) and checked them against Ben's and well, I can't really claim there aren't any errors but seemed mostly valid.
So, yeah! Any help would be much appreciated!
Thanks
1 Answer
Gunjeet Hattar
14,483 PointsHi Marcus,
Just having a quick look at your question. For you last snippet it should be onPostExecute not OnPostExecute i.e. a small o in on.
I'll reach home and check your other errors and revert with a solution.
sentry
3,499 Pointssentry
3,499 PointsEDIT: Ah, looks like one of my curved braces from private void updateList() was spanning past the next block to the end hence the errors. Thanks for the help!
Woops! That fixes my third problem. I still have an issue with GetBlogPostsTask which I'm going to assume is due to a lack of a private/protected/public declaration but adding one results in an error. Perhaps I mistyped something else too?