로딩 작업이 완료되면 즉시 조각을 클릭하고 싶습니다.PlaceAutocompleteFragment : 자동으로 열림 SearchView
조각의 정의는 다음과 같습니다
<fragment
android:id="@+id/place_autocomplete_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
/>
나는이
fragment = findViewById(R.id.place_autocomplete_fragment);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
fragment.performClick();
}
}, 1000);
일을 시도했지만 그것은 일을 일부러.
조각을 자동으로 클릭하는 방법이 있습니까?
편집 : 내 경우는, 조각은 당신은 <fragment>
에 클릭 할 수 없습니다
//PlaceAutoComplete Search Implementation
PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)
getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
@Override
public void onPlaceSelected(Place place) {
Log.i(String.valueOf(this), "Place: " + place.getName() + "\nID: " + place.getId());
String placeId = place.getId();
try {
Intent intent = new Intent(PlaceSearch.this, PlaceDetailsFromSearch.class);
Bundle extras = new Bundle();
extras.putString("placeID", placeId);
intent.putExtras(extras);
startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onError(Status status) {
Log.i(String.valueOf(this), "An error occurred: " + status);
}
});
당신이 무엇을 클릭 후 일어날 것으로 예상됩니까? – azizbekian
이 비디오를 확인하십시오 https://www.youtube.com/watch?v=9RfQOrSlqPs&feature=youtu.be –
필자가 수동으로 조각을 클릭하고 싶지는 않습니다. –