Created
June 16, 2012 07:09
-
-
Save laabroo/2940330 to your computer and use it in GitHub Desktop.
Inisialisasi Posisi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initPosition() { | |
locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); | |
locListener = new LocationListener() { | |
public void onStatusChanged(String provider, int status, | |
Bundle extras) { | |
// TODO Auto-generated method stub | |
} | |
public void onProviderEnabled(String provider) { | |
// TODO Auto-generated method stub | |
} | |
public void onProviderDisabled(String provider) { | |
// TODO Auto-generated method stub | |
} | |
public void onLocationChanged(Location location) { | |
latitude = location.getLatitude(); | |
longitude = location.getLongitude(); | |
getAll(latitude, longitude, radius); | |
tampilkanPosisikeMap(location); | |
} | |
}; | |
locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, | |
1000, locListener); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pada kode ini berguna untuk mendapatkan lokasi berupa Latitude Longitude dan langung mengesekusi fungsi getAll() dan tampilkanPosisiKeMap() dari method sebelumnya.