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

Network is Unavailable - Blog Reader App

Hello!

I've been following the blog reader tutorial and I can't seem to get the app to connect to the network. I wasn't able to get the successful http code 200. The emulator can connect to the internet through the web app, so I know it's not an error there.

I've followed the tutorial to the tee all the way to the "Opening a Webpage in the Browser" tutorial, no errors in the code, everything looks good! But no connection for some reason. So when I run the app in the emulator it shows the spinning progress bar and the toast notification that the "network is unavailable". It is worth noting that the Dialog box doesn't show up either. Without me posting my entire code, does anyone have any idea?

I'm using the latest release of the developer tools, using 4.3 on OSX. Thanks!

1 Answer

I really didn't want to admit to it but I answered my own question. Syntax error, as I'm sure you all knew already! I missed "isAvailable = true;" inside the "if (networkInfo != null && networkInfo.isConnected()) { }"

I should've given it another day before I ran to the forums! Sorry folks!