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 trialTamás Kovács-Ajtai
Full Stack JavaScript Techdegree Student 4,416 PointsBoth my title and author is the same, why? :(
On the line String author = post.getString(KEY_AUTHOR); Variable 'author' initializer 'post.getString(KEY_AUTHOR') is redundant
2 Answers
Tamás Kovács-Ajtai
Full Stack JavaScript Techdegree Student 4,416 PointsNever mind, got it :)
author = Html.fromHtml(title).toString();
instead of
author = Html.fromHtml(author).toString();
Rakesh Saini
4,270 PointsWhat is wrong with this code JSONObject posts = jsonCamp.getJSONObject(i); String title = posts.getString(KEY_TITLE); title = Html.fromHtml(title).toString(); String author = posts.getString(KEY_AUTHOR); author = Html.fromHtml(author).toString(); HashMap<String,String> blogPost = new HashMap<String,String>(); blogPost.put(KEY_TITLE,title); blogPost.put(KEY_AUTHOR,author); blogPosts.add(blogPost);