Android Place Picker (PlacePicker) no longer has Search icon after updating to Google Play Services 9.0.83
Asked Answered
C

1

6

Very recently some of my users began reporting that the search icon had disappeared from the PlacePicker UI widget. I was able to isolate the issue to updating to Google Play Services 9.0.83. Has anybody found a workaround to get the search icon back again?

Update: I also noticed that the setLatLngBounds() method of the PlacePicker.IntentBuilder class no longer functions properly after updating to 9.0.83. It centers the map at 0 lat, 0 long out in the Ocean off the coast of Africa. As long as I do not invoke setLatLngBounds() the PlacePicker will center in on my current location.

Update: I have an idea, but I need everyone's help though. Based on information from this website apkmirror.com there are subversions of 9.0.83 based on the CPU and screen DPI. In the Application Manager, select Google Play Services and the subversion should be in parenthesis next to the version, mine is 440-121911109, please post yours in the comments if you are having the same issue. Maybe we can find a common denominator.

Before updating to Google Play Services 9.0.83
Before updating to Google Play Services 9.0.8

After updating to 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();
        }
    }
}
Calvillo answered 17/5, 2016 at 2:35 Comment(5)
What version of Google Play Services do you compile your app with?Blockish
@Daniel Nugent compile 'com.google.android.gms:play-services:8.4.0'Calvillo
Same problem here. Lost the icon also after deinstalling the updates...Urbanite
and the serious problem #37297491Tarn
Same problem.Does anybody knows when Google will update and fix this?Staging
V
0

This looks like it might be related to the PlacePicker component being out of sync with the device config. One thing you can try is to force a config checkin on affected devices by dialing *#*#2432546#*#* in the Android dialer app.

Vesiculate answered 23/5, 2016 at 0:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.