gpt4 book ai didi

更新到 Google Play Services 9.0.83 后,Android Place Picker (PlacePicker) 不再有搜索图标

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:15:08 25 4
gpt4 key购买 nike

最近我的一些用户开始报告说 搜索图标 已经从 PlacePicker UI 小部件中消失了。我能够将问题隔离到更新到 Google Play 服务 9.0.83。是否有人找到了重新恢复搜索图标的解决方法?

更新:我还注意到 PlacePicker.IntentBuilder 类的 setLatLngBounds() 方法在更新到 9.0.83 后不再正常运行。它将 map 居中于 0 lat,0 long 在非洲海岸外的海洋中。只要我不调用 setLatLngBounds(),PlacePicker 就会以我当前的位置为中心。

更新:我有一个想法,但我需要大家的帮助。基于本网站的信息apkmirror.com有基于 CPU 和屏幕 DPI 的 9.0.83 版本。在应用程序管理器中,选择 Google Play 服务,版本号应该在版本旁边的括号中,我的是 440-121911109,如果您遇到同样的问题,请在评论中发布您的版本。也许我们可以找到一个共同点。

更新到 Google Play 服务 9.0.83 之前
Before updating to Google Play Services 9.0.8

更新到 Google Play Services 9.0.83 后
After updating to Google Play Services 9.0.83

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 组件与设备配置不同步有关。您可以尝试的一件事是 force a config checkin on affected devices by dialing *#*#2432546#*#*在 Android 拨号器应用程序中。

关于更新到 Google Play Services 9.0.83 后,Android Place Picker (PlacePicker) 不再有搜索图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37266209/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com