我有一个LocationReceiver
用于FusedLocationProviderApi.KEY_LOCATION_CHANGED
从. 但是现在已弃用我应该将其更改为什么?Location
Intent
KEY_LOCATION_CHANGED
当前代码:
@Override
public void onReceive(Context context, Intent intent) {
final Location location = (Location) intent.getExtras().get(FusedLocationProviderApi.KEY_LOCATION_CHANGED);
if (location != null) {
float accuracy = location.getAccuracy();
Log.d(LocationReceiver.class.getSimpleName(), "*** Accuracy is: " + accuracy + " ***");
} else {
Log.d(LocationReceiver.class.getSimpleName(), "*** location object is null ***");
}
}