Android Place Picker(PlacePicker)在更新至Google Play服务后不再具有搜索图标9.0.83
问题描述:
最近,我的一些用户开始报告搜索图标已从PlacePicker UI小部件中消失。我能够将问题隔离到更新到Google Play服务9.0.83。有没有人找到解决方法让搜索图标又回来了?Android Place Picker(PlacePicker)在更新至Google Play服务后不再具有搜索图标9.0.83
更新:我也注意到,setLatLngBounds()更新到9.0.83后PlacePicker.IntentBuilder类的方法不再正常。它将地图定位在非洲海岸外的0海里,长达0海里。只要我不调用setLatLngBounds(),PlacePicker将集中在我当前的位置。
更新:我有一个想法,但我需要每个人的帮助。基于来自本网站apkmirror.com的信息,基于CPU和屏幕DPI的版本有9.0.83。在应用程序管理器中,选择Google Play Services,颠覆应该在版本旁边的括号中,我的是440-121911109,如果您遇到同样的问题,请在评论中发表您的意见。也许我们可以找到一个共同点。
static final int PPR = 41;
private GoogleApiClient googleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.place_picker_activity);
googleApiClient = new GoogleApiClient
.Builder(this)
.addApi(Places.GEO_DATA_API)
.addApi(Places.PLACE_DETECTION_API)
.enableAutoManage(this, this)
.build();
Button btnLaunch = (Button) findViewById(R.id.buttonLaunch);
btnLaunch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (googleApiClient.isConnected()) {
try {
PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
startActivityForResult(builder.build(PlacePickerActivity.this), PPR);
} catch (GooglePlayServicesRepairableException e) {
e.printStackTrace();
} catch (GooglePlayServicesNotAvailableException e) {
e.printStackTrace();
}
} else {
Toast.makeText(getApplicationContext(),"Google api not connected yet", Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
protected void onStart() {
super.onStart();
googleApiClient.connect();
}
@Override
protected void onStop() {
super.onStop();
if (googleApiClient.isConnected()) {
googleApiClient.disconnect();
}
}
@Override
public void onConnected(Bundle connectionHint) { }
@Override
public void onConnectionFailed(ConnectionResult result) {
Toast.makeText(getApplicationContext(), "Connection failed: " + result.getErrorCode(), Toast.LENGTH_LONG).show();
}
@Override
public void onConnectionSuspended(int cause) {
Toast.makeText(getApplicationContext(), "Connection suspended",Toast.LENGTH_LONG).show();
googleApiClient.connect();
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == PPR) {
if (resultCode == RESULT_OK) {
Place place = PlacePicker.getPlace(this, data);
Toast.makeText(this, ""+place.getName(), Toast.LENGTH_LONG).show();
}
}
}
答
这看起来可能与后到PlacePicker组件与设备配置不同步。你可以尝试的一件事是在Android拨号器应用程序中的force a config checkin on affected devices by dialing *#*#2432546#*#*。
您使用什么版本的Google Play服务编译应用程序? –
@Daniel Nugent编译'com.google.android.gms:play-services:8.4.0' –
此处同样的问题。在卸载更新后还丢失了图标... – roNn23