Skip to content

Instantly share code, notes, and snippets.

@phpmaps
Created April 26, 2013 00:05
Show Gist options
  • Save phpmaps/5464216 to your computer and use it in GitHub Desktop.
Save phpmaps/5464216 to your computer and use it in GitHub Desktop.
Get location providers from a Droid's LocationManager
LinearLayout providerListLayout = (LinearLayout) findViewById(R.id.providerList);
LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
providers = locationManager.getProviders(true);
for (String provider : providers) {
System.out.println(provider);
final TextView row = new TextView(this);
row.setText(provider);
providerListLayout.addView(row);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment