breaking my head here, i have searched online for quite a bit and it seems this was a bug on android before but have not found a solution yet.
I have a AutoCompleteTextView:
autodesignations = (AutoCompleteTextView) findViewById(R.id.main_autocomp);
adapterShapesAuto = new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line, shapes);
autodesignations.setAdapter(adapterShapes);
the widget works, but the dropdown text is always white text on white background.
I have tried setting the resource for the adapter to several combinations of android's built-in layouts & also my own.
Even pointing it to a TextView resource being also use for a Spinner (which works as expected, black text on white background), but have found no way of making this work, keep getting the same results
Any help?
I had this issue . Fixed it using android.R.layout.select_dialog_item for layout.
So here is the answer for my issue.
As often, this and a context reference are not exactly the same. Maybe because the context reference might be passed down across some activities, whatever.
So I changed that line (which is included inside a onClickListener) where 'context' is retrieved during onCreate() by getApplicationContext();
adapterListModele = new ArrayAdapter<String>(context, android.R.layout.select_dialog_item, listModeleNom);
into the following line where I used a this from my class :
adapterListModele = new ArrayAdapter<String>(AncestorVehicule.this, android.R.layout.select_dialog_item, listModeleNom);
And it works ! No more white font.
I tested it outside the onclicklistener callback and noticed 2 things :
Hope it helps someone else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With