O seletor do Android Service Place do Google setLatLngBounds () não está funcionando
Estou usando o PlacePicker no meu aplicativo. De repente, está se comportando mal. Quando é lançado, aponta para (0,0, 0,0) lat. Não tenho certeza se o serviço do Google mudou alguma coisa. anteriormente ele estava funcionando bem, pois a partir de 3 dias não está funcionando.
Estou fazendo alguma coisa errada aqui
É assim que estou lançando o Activity.
private void launchPlacePicker(double latitude, double longitude) {
try {
showProgress(true);
PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
Log.d(TAG, " launchPlacePicker " + latitude + " " + longitude);
builder.setLatLngBounds(MapUtils.getLatLngBounds(new LatLng((double) latitude, (double) longitude)));
startActivityForResult(builder.build(this), PLACE_PICKER_REQUEST);
} catch (GooglePlayServicesRepairableException e) {
showProgress(false);
Log.e(TAG, "GooglePlayServicesRepairableException", e);
} catch (GooglePlayServicesNotAvailableException e) {
showProgress(false);
Log.e(TAG, "GooglePlayServicesNotAvailableException", e);
}
}
É assim que eu estou criando LatLngBounds
public static LatLngBounds getLatLngBounds(LatLng center) {
double radius = 100;
LatLng southwest = SphericalUtil.computeOffset(center, radius * Math.sqrt(2.0), 225);
LatLng northeast = SphericalUtil.computeOffset(center, radius * Math.sqrt(2.0), 45);
return new LatLngBounds(southwest, northeast);
}
e eu tentei criar LatLngBounds como abaixo, ainda o mesmo resultado.
public static LatLngBounds getLatLngBounds(LatLng center) {
LatLngBounds.Builder builder = LatLngBounds.builder();
builder.include(center);
return builder.build();
}
Alguém poderia me ajudar