AutoCompleteTextView background/foreground color

I am working on AutoCompleteTextView.Its working fine but the dropdown text is always white text on white background.
this picture explain my problem

picture explain my problem

  • Android ViewPager dimension
  • How do I manage cookies with HttpClient in Android and/or Java?
  • Android httpclient file upload data corruption and timeout issues
  • Refresh a page in ionic2
  • Create aar file in Android Studio
  • Remove LoginActivity from Manifest - Facebook SDK for Android 3.0
  • enter image description here


    <LinearLayout xmlns:android=""
        <!-- <AutoCompleteTextView  -->
            android:hint="Tapez votre 1texte"


    view = (AutoCompleteTextView)findViewById(;        
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line,data);

    Related posts:

    Android NDK timers
    How to show &ldquo;Loading&rdquo; status in Android?
    How to make a listener for a datepickers cancel button in Android?
    How to use the new SD card access API presented for Android 5.0 (Lollipop)?
    Get product flavor or build variant in an android app
    How to create JSON format data in android?
  • Bluetooth connection between Android and another phone over the Handsfree profile
  • Add a Textview to a FrameLayout in a determined position
  • How to make transparent gradient?
  • Handwriting recognition API's for android applications
  • Non-Scrolling Fragment in a ViewPager inside CoordinatorLayout
  • ZipAlign verification
  • 6 Solutions collect form web for “AutoCompleteTextView background/foreground color”

    If you want to change the look of the dropdown items change the XML layout you pass to the ArrayAdapter, (in your case this is android.R.layout.simple_dropdown_item_1line).

    Lets make a new layout named my_list_item.xml in res/layout:

    <TextView xmlns:android=""
        android:textColor="#00f" />

    This text is smaller, blue, and centered. I don’t recommend using this layout, it’s more to demonstrate that you can customize it.

    Now use this instead:

    view = (AutoCompleteTextView)findViewById(;        
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.my_list_item, data);

    When you set attributes here (like the text color):

        android:hint="Tapez votre 1texte"

    You are only changing the box above the dropdown list (the box that you see before you interact with the AutoCompleteTextView). Hope that helps!

    This question might be old but I believe this is very important for me to share.
    I had been experiencing the same problem as OP but it is because I was using ‘getApplicationContext()’ in place of ‘this’


    ArrayAdapter<String> adapter = new ArrayAdapter<String>
                    (getApplicationContext(), android.R.layout.simple_list_item_1, PLACES);


    ArrayAdapter<String> adapter = new ArrayAdapter<String>
                    (this, android.R.layout.simple_list_item_1, PLACES);

    A tricky solution for this is:
    Add this line
    setTheme(; before setContentView() in your activity file in which your autocompletetextview is present. Let me know if this works.

    Answer by didldum

    workaround by extending the theme and overriding the 2 styles for the typed text and the suggest text:

    1. use an extended theme in your manifest:

    2. create the new theme (res/values/themes.xml) which uses fixed styles:


    3. create the styles (res/values/styles.xml) which fix the color:



    I tried setting up the theme before setcontext, tried different resources parameter in arrayAdapter and tried different theme ,but nothing helped.

    Then I changed the context from ‘this’ to ‘getApplicationContext’ but the problem was persistent.

    Finally I changed the context parameter to “getBaseContext()” and the problem was solved.

    i got my solution in slecting layout of “select_dialog_singlechoice
    ArrayAdapter<String > s1= new ArrayAdapter<String>
    enter image description here

    instead of get application context write “this” in ArrayAdapter<>;

    try using different layouts u will definately solve your queries

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.