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 trialAndrew Antwine
1,412 PointsCode Switched In The Video (Unknown Reason)
Hello, I am confused to why the code has changed and how I should be looking at it? In the last activity, line 24 code was set up as follows.
***Java mStartButton.setOnClickListener(new View.OnClickListener());
Today, I am trying to add a second activity and my code now doesnt match up to what we were shown to use in the last video. It just jumps from the last code to the new code with no explanation. Here is what line 24 now looks like:
***Java mStartButton.setOnClickListener((v) -> { };
I was wondering if I missed something or if I am just blind. Any help would be great! Thanks, Andrew :)
1 Answer
Harry James
14,780 PointsHey Andrew!
This is part of Android Studio and it does this to make your code easier to read. If you click on the code, it will expand it out back to how it was earlier.
Hope it helps :)