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 Build a Weather App (2015) Concurrency and Error Handling Handling Errors

oscar gonzalez
oscar gonzalez
7,072 Points

Hello I got trouble with this activity, I made all this step as the video But I got an error in getActivity();

hello I made all that the video teach me, But i got an error, I wrote the same code as video did, equals i mean i checked over and over again and all is the same, In the line Context context = getActivity(); it's mark as an error, please let me know what I am doing wrong?

Maybe the current version to I use is android studio 1.1 in the video is the old version than this.

3 Answers

Can you post the class file?

when you hover your cursor over the error what does it say?

oscar gonzalez
oscar gonzalez
7,072 Points

it said unreachable statement!!! what does it mean?

ahh ok you have a return statement just inside your onCreate function. When you return inside a function, it will not process past that spot. Remove return and you should be all set.

oscar gonzalez
oscar gonzalez
7,072 Points

it said unreachable statement!!! what does it mean?

oscar gonzalez
oscar gonzalez
7,072 Points

it said unreachable statement!!! what does it mean?