0
votes

as the background color and text color of suggetsed text in AutoCompleteTextBox in android are same so the suggetsed text is not visible, my xml file is:

            <AutoCompleteTextView
            android:id="@+id/autoCompleteTextView1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="2.4"
            android:background="#ffffff"
            android:ems="10"
            android:textColor="#000000" >
            </AutoCompleteTextView>

and my manifest file is:

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="9" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

and my java file is: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.patient_registration);

    // Get a reference to the AutoCompleteTextView in the layout
    AutoCompleteTextView textView = (AutoCompleteTextView)    findViewById(R.id.autoCompleteTextView1);
    // Get the string array
    String[] countries = { "jan", "fbe", "mar", "june", "kokok", "opopopo" };
    // Create the adapter and set it to the AutoCompleteTextView
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, countries);
    textView.setThreshold(1);

    textView.setAdapter(adapter);

}
1

1 Answers

1
votes

Try to use android.R.layout.simple_dropdown_item_1line instead of android.R.layout.simple_list_item_1 - it worked for me.