1

I am using the autocomplete support fragment from the Google Places API and am facing a small issue. When I click on the search button (Shown in 1).

enter image description here

I am able to see image 2. But what I want to see is image [3]. I want the keyboard to be up as soon as I click on the search button but instead, I need to make 2 clicks to get the keyboard.

enter image description here

Neeraj Athalye
  • 508
  • 5
  • 26

1 Answers1

0

From the looks of the pictures, it seems you're using overlay place picker not full display. Then your code should be like this using an Autocomplete.IntentBuilder to create an intent to launch the autocomplete widget as an intent:

int AUTOCOMPLETE_REQUEST_CODE = 1;
List<Place.Field> fields = Arrays.asList(Place.Field.ID, 
Place.Field.NAME);

// Start the autocomplete intent.
 Intent intent = new Autocomplete.IntentBuilder(
    AutocompleteActivityMode.FULLSCREEN, fields)
    .build(this);
 startActivityForResult(intent, 
 AUTOCOMPLETE_REQUEST_CODE);

You can either replace the FULLSCREEN with OVERLAY depending on your choice.

Jay
  • 41
  • 1
  • 1
  • 5