Arayadapter only shows text when highlighted

by Android_n00b » Fri, 18 Sep 2009 08:47:50 GMT


Sponsored Links
 I have an arrayadapter which stores the names of the 12 months of the
year:
final String[] Months = new String[]
{"January","February","March","April","May","June","July","August",
                "September","October","November","December"};
ArrayAdapter<String> monthArray = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, Months);

I also have a textview where if I enter some text, the matching text
in the arrayadapter appears below the textbox.
final AutoCompleteTextView textView = (AutoCompleteTextView)
findViewById(R.id.testAutoComplete);
textView.setAdapter(monthArray);

For example, if I start typing the characters of January, I should see
the word January appear below the textbox (like how google suggest
works). So my program seems to be working, but when I start typing Jan
for example, a box appears below with the word January in it, but I
can only see the text when it is highlighted. So for some reason, the
text is the same colour as the background box(white in this case).
Anyone know why this is happening?

Thanks!

--~--~---------~--~----~------------~-------~--~----~



Arayadapter only shows text when highlighted

by Mark Murphy » Fri, 18 Sep 2009 17:26:46 GMT


 


What layout are you using for the ArrayAdapter used for the
AutoCompleteTextView?

 http://developer.android.com/guide/tutorials/views/hello-autocomplete.html 

ArrayAdapter adapter = new ArrayAdapter(this,
            android.R.layout.simple_dropdown_item_1line, COUNTRIES);

If you do not wish to use android.R.layout.simple_dropdown_item_1line,
that is fine, but you will need to then adjust your own custom layout to
have the right color scheme for drop-down lists.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.1 Available!

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. How to use a CSR Wi-Fi Chip in Android?

How to use a CSR Wi-Fi Chip in Android?

and..

Unifi Drivers for the compilation process, how to?

I will wait for your answer. Thanks.

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Visual Voice mail

Hi ,

I want to develope Visual voice mail application. is there any spec to
follow up like  3gpp for messagging.

Please guide me if any body have any idea . how i can start the
implementation of this app.

Cheers,
Raghu.

--~--~---------~--~----~------------~-------~--~----~

3. Dynamic Widget Size

4. Change minWidth/minHeight AppWidget

5. Rado's Colorthon Tutorial Now Available on YouTube

6. Thread is stopping alone...

7. Android Developer Challenge