0
저는 webdeveloper이고 3 개의 AutoCompleteTextView를 사용하여 Android 애플리케이션에 로직을 구현하려고합니다. 하나의 AutoCompleteTextView를 시도하고 정상적으로 작동했습니다. 3 AutoCompleteTextView있을 때 작동하지 않습니다. 이걸 도와주세요.두 개 이상의 AutoCompleteTextView가 작동하지 않습니다.
이것은 내 레이아웃 코드입니다.
<AutoCompleteTextView android:id="@+id/textExecutive"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_executive" />
<AutoCompleteTextView android:id="@+id/textSupervisor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_supervisor" />
<AutoCompleteTextView android:id="@+id/textManager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_manager" />
이
은textExecutive.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View paramView, MotionEvent paramMotionEvent) {
// TODO Auto-generated method stub
textExecutive.showDropDown();
textExecutive.requestFocus();
return false;
}
});
마찬가지로 다른 두를 수행에서 onCreate
textExecutive = (AutoCompleteTextView) findViewById(R.id.textExecutive);
textSupervisor= (AutoCompleteTextView) findViewById(R.id.textSupervisor);
textManager= (AutoCompleteTextView) findViewById(R.id.textManager);
String[] executives = getResources().getStringArray(R.array.executives_array);
String[] supervisors = getResources().getStringArray(R.array.supervisors_array);
String[] managers = getResources().getStringArray(R.array.managers_array);
ArrayAdapter<String> executivesAdapter =
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, executives);
ArrayAdapter<String> supervisorsAdapter =
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, supervisors);
ArrayAdapter<String> managersAdapter =
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, managers);
textExecutive.setAdapter(celebritiesAdapter);
textSupervisor.setAdapter(eventsAdapter);
textManager.setAdapter(itemsAdapter);
어떤 종류의 오류가 발생 했습니까? –
오류가 없습니다. 자동 완성 프로세스가 작동하지 않습니다. –
_ 작동하지 않습니다. 무엇을 의미합니까? – Piyush