Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save taywils/5633124 to your computer and use it in GitHub Desktop.
Save taywils/5633124 to your computer and use it in GitHub Desktop.
The onCreate() method for the Android Google Places Tutorial
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.httptestlist);
LocationManager locationManager = (LocationManager) getSystemService(
Context.LOCATION_SERVICE);
LocationListener myLocationListener = new MyLocationListener();
locationResult = new MyLocation.LocationResult() {
@Override
public void gotLocation(Location location) {
latitude = String.valueOf(location.getLatitude());
longitude = String.valueOf(location.getLongitude());
progressDialog.dismiss();
new GetCurrentLocation().execute(latitude, longitude);
}
};
MyRunnable myRun = new MyRunnable();
myRun.run();
progressDialog = ProgressDialog.show(HttpTestActivity.this, "Finding your location",
"Please wait...", true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment