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 Android Lists and Adapters (2015) Acting on List Item Taps Tapping on a ListView Item

no errors, but app kept crashing when i hit the "7 Day Button"

Hi, my app kept crashing when i pressed the "7 Day" Button. The code was 100% right, logcat showed no errors at all, debugg did not show me anything either. I searched for the problem ALOT of hours, but did not find anything.

At last i was really pissed and just downloaded the project from here and overwrote one file after the other to see which one was false.

It was the DayAdapter that caused the error, because replacing it with the file from Ben solved the unknown problem. To see what i missed i placed both codes next to each other on the screen and went trough it LINE BY LINE.

They are IDENTICAL!

And yes of course i try´d restarting android studio, clean the project and rebuild it, that did not work.

Everything is fine now, but i really want to know what could cause this???

Hi it will happen every time you click the hourly/7 day button and json data still processing so don't click it until the data is processing

my solution to this is first set the dailybutton/hourlyButton enabled state to false at the onCreate so the user won't accidentally tap the button to avoid crash, when that data is already there then setEnabled to true of the two buttons