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

Blog Reader App has no errors but crashes when clicked in emulator (been stuck for 2 weeks on this?)

2 Answers

Right smack in the center of the first picture you posted, it tells you exactly whats wrong.

Caused By ...... : " Your content must have a listview whose id attribute is "android.R.id.list "

Go to your layout file, and if there is not a listview in it already, create one, and give it the correct attribute ID referenced above. If there is a listview, you probably still need to add the attribute ID.

is it in the xml file?

Its supposed to be.

Consider this,

You have a variety of XML files as part of your project, the manifest, string list, dimens, and the Layout files are all in XML for example.

In your particular case, your app is looking for the corresponding element in ANY of your Layout xml files. Most UI items that you actually interact with, or have some sort of logic to them rely on a two step process. You generally first put the items in the XML layout ( or the drag and drop WYSIWG editor, which does the same thing for you ) and assign them an ID so that they can be referenced outside of the layout ( it generates an int constant ). Once you have an item in your layout, and it is assigned an ID, you then wire it into the programming side of your app by declaring a variable of the appropriate view, casting it, and pointing it to the correct reference ID. Pointing it to the correct reference ID is important, as it bridges the gap between whatever variable you decide to define as "your" item, versus what is actually in the layout.

added what the cause told me but still crashes? http://imgur.com/Sif3p5Y