LocationManager 的requestLocationUpdates用于本地信息更新

 
     
         
         
     
 

 

public class LocationReceiver extends BroadcastReceiver { 
    @Override 
    public void onReceive(Context context, Intent intent) { 
    //Do this when the system sends the intent 
    Bundle b = intent.getExtras(); 
    Location loc = (Location)b.get("KEY_LOCATION_CHANGED"); 
 
    Toast.makeText(context, loc.toString(), Toast.LENGTH_SHORT).show();  
    } 
}

 

你可能感兴趣的:(android)