'PlaceAutocompleteFragment unable to write into edittext?
i want to create place auto complete fragment using Places sdk API from google, i create the fragment in xml below
<fragment
android:id="@+id/place1"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="7" />
and this is my java code
place1 = (PlaceAutocompleteFragment)
getFragmentManager().findFragmentById(R.id.place1);
place1.setOnPlaceSelectedListener(new PlaceSelectionListener() {
@Override
public void onPlaceSelected(Place place) {
AddPlace(place, 1);
}
@Override
public void onError(Status status) {
}
});
the problem is the EditText of search is disabled and cannot write into it
below my gradle:
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.android.gms:play-services-places:16.0.0'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|