views:

26

answers:

0

I have a chat app and one the problems I haven't been able to solve is the EditText input box stops showing text after a while. I've verified the problem myself but it seems to depend on the IME you use. I use HTC's ime and have never had the problem. For purposes of finding the problem, I switched to stock Android ime and the problem showed up quite quickly.

After a bit of typing and sending messages, once you type, the EditText no longer seems to redraw and show the input. If you hide the IME, the text reappears.

The problem seems to have started around the time I made an option for disabling/enabling auto correction and capitalization. The code I'm using for that is below:

final boolean auto = prefs.getBoolean(getString(R.string.pref_auto_cap_correct), true);

int types = mEt.getInputType();
types = auto
     ? types | (InputType.TYPE_TEXT_FLAG_AUTO_CORRECT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES)
     : types & ~(InputType.TYPE_TEXT_FLAG_AUTO_CORRECT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);

mEt.setInputType(types);

and my layout xml is:

    <EditText 
        android:id="@+id/et"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"     
        android:layout_above="@id/suggest_sb"
        android:freezesText="true"
        android:layout_toRightOf="@id/status"
        android:nextFocusRight="@+id/sv"
        android:nextFocusLeft="@+id/sv"
        android:imeOptions="actionSend"
        android:layout_toLeftOf="@id/arrow_right"
        android:inputType="textLongMessage"
    />

I'd really like to get to the bottom of this.