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
final String[] Months = new String[]
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)

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?



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

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)  | 

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


Sponsored Links

Other Threads

1. Reject an incoming call in RIL


I met a problem on RIL and it would reject an incoming call from
sending AT command 'AT+CHLD=0' to modem automatically. I did repo
sync and retrieved master tree from android git server last week.
My platform version name is Donut.

The scenario is like this: I run two Android emulators in my machine.
One is 'emulator-5554' and the other is 'emulator-5556'. Both of them
can camp to fake (virtual) Android 3G network. I dial out a number
'5556' from 'emulator-5554' to 'emulator-5556'. Then I can see a dial-
out screen disappeared in few seconds. Therefore, I use logcat to read
the radio logs. Then I find 'emulator-5556' would reject this incoming
call and not display any incoming screen in UI. Does any one meet this
problem? or is it a known issue? or anyone know how to fix it?

reproduce steps as below:
$ repo init -u git://
$ repo sync
$ make
$ cd out
$ ./host/linux-x86/bin/emulator -system ./target/product/generic/
system.img -sysdir ./target/product/generic/system -data ./target/
product/generic/userdata.img -kernel ../prebuilt/android-arm/kernel/
kernel-qemu -ramdisk ./target/product/generic/ramdisk.img [twice]

Dial out a number '5556' from emulator-5554 Dialer UI
$ adb -s emulator-5554 logcat -b radio -d > radio.log.5554
$ adb -s emulator-5556 logcat -b radio -d > radio.log.5556

Also, I tried to use an external GSM modem with Android emulator and I
got the same situation too. I can camp to the real GSM network, but
cannot receive any phone calls.

Best Regards,
Erin Yueh

2. Filter out contacts from contacts pick list || option to create new contact from pick list

Even this is not helping


3. How to do we take a Screenshot using ADB Comand Line

4. problem with Hello, Gallery R.styleable not resolve

5. Create New TextView Style....

6. Showing directions or drawing required path on Google Maps

7. setPadding() in onDraw() causing ListView draw loop