Skip to content

Autocomplete results stop showing #1008

@jollygreenegiant

Description

@jollygreenegiant

I'm using the Autocomplete UI component using launchActivityForResult() with the following code:

@Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        if (item.getItemId() == R.id.search_button) {

            // Start the autocomplete intent.
            Intent intent = new PlaceAutocomplete.IntentBuilder()
                    .accessToken(Mapbox.getAccessToken())
                    .placeOptions(PlaceOptions.builder()
                            .language(Locale.getDefault().getLanguage())
                            .backgroundColor(Color.parseColor("#EEEEEE"))
                            .build(PlaceOptions.MODE_CARDS))
                    .build(getActivity());
            startActivityForResult(intent, 1);
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == 1) {
            if (resultCode == RESULT_OK) {
                CarmenFeature feature = PlaceAutocomplete.getPlace(data);
                initializeWeatherData(feature.center().latitude(), feature.center().longitude());
            }
        }
    }

When the app is first installed, everything is fine, and it seems to work the first several times, but after a while (or maybe a certain number of searches?) it stops returning any results, either while typing or after clicking the search button. Is this an issue with the API or something I've written? I assume it's in my code, but I don't know how to debug it and view the calls and responses. Gif of behavior is attached below, running on Google Pixel 3XL, Android Q (API 29).

I have tested on multiple Wi-Fi networks, as well as mobile data, with no luck. Once it stops working, it doesn't come back until I uninstall and reinstall the app.

ezgif com-video-to-gif

Metadata

Metadata

Assignees

No one assigned

    Labels

    places-pluginIssues that deal with the places plugin module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions