ppamorim

Untitled

Jan 1st, 2015
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1.     @Override
  2.     public void onLocationChanged(Location location) {
  3.  
  4.         try {
  5.    
  6.             //Get address infos with Geocoder class
  7.             List<Address> addresses = new Geocoder(getActivity(), Locale.getDefault())
  8.                     .getFromLocation(location.getLatitude(), location.getLongitude(), 1);
  9.  
  10.             //Return the address of user
  11.             String actualAddress = addresses.get(0).getAddressLine(0);
  12.  
  13.             mActualLocation.setText(actualAddress);
  14.  
  15.         } catch (Exception e) {
  16.             e.printStackTrace();
  17.         }
  18.  
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment