Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String getLatLng(Context context, Location currentLocation) {
- // If the location is valid
- if (currentLocation != null) {
- // Return the latitude and longitude as strings
- return context.getString(
- R.string.latitude_longitude,
- currentLocation.getLatitude(),
- currentLocation.getLongitude());
- } else {
- // Otherwise, return the empty string
- return EMPTY_STRING;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement