2

i have an android application in which i have a couple of spinner controls. The default nature of the spinner control is such that the it displays the text that you select from the adapter you have connected it.

In all the other phones the spinner controls are behaving the above mentioned way. But on the motorolla defy with Android 2.2 , i am not able to see the text that i have selected on the spinner control.

My app has Google app 2.2 associated with it and is coded to run on devices with OS 2.1 to OS 2.3.

why is this problem occuring only with motorolla defy?

Thank you in advance.

user590849
  • 11,655
  • 27
  • 84
  • 125

3 Answers3

1

The Motorolla Defy displays text as white unless you explicitly specify a different color

kmb64
  • 1,513
  • 2
  • 17
  • 29
0

I've try this code and it does work with me on the Emulator with Android 2.2 :

String[] secteurs = getResources().getStringArray(R.array.Secteurs);
ArrayAdapter<String> sectAddapter = new ArrayAdapter<String>(this, R.layout.list_item, secteurs);

Notice that the Array R.array.Secteurs is a String-Array that contains countries. set the adater like that :

Spinner sectSpinner = (Spinner) findViewById(R.id.spinner3);
sectAddapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sectSpinner.setAdapter(sectAddapter);

For me it works on the Emulator ! i hope I answered you !

Walid Laribi
  • 150
  • 8
0

The answer is very simple and kind of dumb. All i had to do was set the text property to android:textColor = "#000000".

user590849
  • 11,655
  • 27
  • 84
  • 125