I am using auto complete places widget by Google. I noticed that when I place it in my activity and I click on it then it opens a fragment on top of my activity (with a status bar although my activity is full screen)
How can I embed the whole behavior within my activity so the widget being clicked on to initiate search is actually the same widget populated with suggestions
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:background="@null"
app:layout_constraintBottom_toBottomOf="@+id/ibLocationAction"
app:layout_constraintEnd_toStartOf="@+id/ibLocationAction"
app:layout_constraintStart_toEndOf="@+id/ibClose"
app:layout_constraintTop_toTopOf="@+id/ibLocationAction">
<fragment
android:id="@+id/autocomplete_fragment"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.cardview.widget.CardView>
PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)
getFragmentManager().findFragmentById(R.id.autocomplete_fragment);
autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
@Override
public void onPlaceSelected(Place place) {
Log.i(GlobalVar.TAG, "Place: " + place.getName());
chosenPlace = place;
}
@Override
public void onError(Status status) {
Log.i(GlobalVar.TAG, "An error occurred: " + status);
}
});