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

Waiting for... in my example, my location before continuing

This is from Stormy app with location aware

The main activity makes a call to build an api client This is all done in a seperate class I create a google api client for location services and use callbacks I then tell it to connect

The main thread then continues and calls getForecast

Later on onConnected gets called as it gets connected and I can get a location

My question is how can i wait in the man activity class for this connection before I continue and try to get a forecast?