Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7543793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:31:12+00:00 2026-05-30T08:31:12+00:00

My Android application contains an EditText view where you can type some short messages

  • 0

My Android application contains an EditText view where you can type some short messages (single line). Pressing the keyboard’s DONE key will append the message to a log view above (TextView) and clear the input view.

Here’s a snippet from my view xml:

<LinearLayout ...>
    <TextView
        android:id="@+id/logView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <EditText
        android:id="@+id/inputView"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:imeOptions="actionDone"
        android:singleLine="true" />
</LinearLayout>

To handle the input and reset the view, I use the OnEditorActionListener.

@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    ...
    String input = mInputView.getText().toString();
    mInputView.setText(""); // clear the input view
    ...
}

The problem

I did not experience any problems on Android 1.6 – 3. But starting with IceCreamSandwich (>= Android 4) there’s a weird bug which occurs intermittently (in most cases after ~10-30 inputs).

When you type some text, the input view remains blank. The cursor still blinks on position 0, no text is shown. Though a click on DONE adds the (invisible) text to the log view above and the text can be read. Also hiding the keyboard makes the text in the EditText view visible.

Solution

As stated in the accepted answer this is a (not so much) known bug of the Android OS. The simple solution is to clear the EditText view in a different way:

TextKeyListener.clear(mInputView.getText());
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:31:13+00:00Added an answer on May 30, 2026 at 8:31 am

    I had exactly the same issue, even on lower API levels. There’s a bug when using:

    editText.setText("");
    

    many times to empty an EditText. Here’s a workaround that helped:

    TextKeyListener.clear(editText.getText());
    

    You can read about this bug on the Google Code site: http://code.google.com/p/android/issues/detail?id=17508

    Hope it helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using proguard to obfuscate my android application. The android application contains some
In my Android application, when I rotate the device (slide out the keyboard) then
I am facing to android application signing problem. My application contains Google MapView. When
I'm currently trying to develop an android application in eclipse(java) which shows some jokes
I have an Android application that generates some HTML which is rendered locally, in
I'm developing an Android application for accessing some battle.net ( https://eu.battle.net ) account data
Since yesterday, our application description on the Android Market web version contains two sets
I have an android application which contains four modules(I mean four apk's).Each module has
I have a service running in my Android application which contains a HashMap that
I have an Android application which is a tab layout and contains 3 tabs.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.