0

我已經在我的活動上實施了位置服務,,,,當我在onlocation上更改位置時......我將使用Geocoder將其轉換爲地址...現在,我需要設置值鑑於尋呼機內的片段......怎麼辦that..please幫助..片段通信onlocation的活動發生變化

@Override 
public void onLocationChanged(Location location) { 

    latitude = location.getLatitude(); 
    longitude = location.getLongitude(); 

    address = Utility.getAddress(RegistrationPersonaliseActivity.this, location); 

    Log.e("tag", "Lat-->" + latitude + "long-->" + longitude + "Address-->" + address); 


} 

回答

0
@Override 
public void onLocationChanged(Location location) { 

    latitude = location.getLatitude(); 
    longitude = location.getLongitude(); 

    address = Utility.getAddress(RegistrationPersonaliseActivity.this, location); 

    Prefs.setLoc(address); 
} 


    final Handler ha=new Handler(); 
    ha.postDelayed(new Runnable() { 

     @Override 
     public void run() { 
      //call function 
      place.setText(Prefs.getLoc()); 
      ha.postDelayed(this, 10000); 
     } 
    }, 10000);