Can anybody help?
Use android.R.layout.simple_spinner_item
in the ArrayAdapter
constructor, not android.R.layout.simple_spinner_dropdown_item
.
Your programmatically added Spinner
is using a holographic widget theme, like Theme.Holo
. Your "static spinner" -- however you got it -- is using a legacy theme, like Theme
. If you want them to look the same, they need to use the same theme. Normally, this happens automatically.
If you got @style/AppTheme
from Eclipse or Android Studio relatively recently (within the past several months), and did not change anything in the generated styles.xml files, then this should give you a theme based on Theme.Holo
when running on an API Level 11+ device or emulator.
You need to Get rid of android:background
and android:spinnerMode
from your two static elements.