Search code examples
androidactionbarsherlock

ActionBarSherlock and custom TextBox (extends AutoCompleteTextView)


OK, I'm going crazy over this - I've integrated ActionBarSherlock in my app and am using Theme.Sherlock. Now, I can't seem to get my custom textbox to work properly - whenever I leave textbox, text becomes white. Here is image to better explain the problem (I've used Overlay layout from examples that come with the library):

Typing:

Step 1 - Typing

Going back to EditText:

Step 2 - Going back EditText

Does anyone have idea why this is happening?

EDIT: To reproduce this error simply download the ActionBar zip and extract sample project. Then in that project in Overlay layout (res/layout/overlay.xml) in first LinearLayout just add:

<EditText 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:imeOptions="actionNext" />
<AutoCompleteTextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />

And run sample project on device with older version of Android OS.


Solution

  • OK, now I get it why nobody was able to answer this - it seems to happen only on specific devices! So, in my case I was reproducing it on old Amazon Kindle.

    The current workaround I finally found, that works for me, is to set textColor of my control by getting textColor of default EditText (yeah, pretty ugly).

    If someone has better idea - do let me know.