title: Strange error for onEditorAction : "unmatched pair of setHasTransientState calls"
body: <p>I have a <strong>EditText</strong> in my fragment and when I perform enter or any action that count like enter, I want to do something. But I had some problems with the <code>onEditorAction</code> ids of <code>KeyEvent</code> or <code>actionId</code> so I follow another thread in this site that helps me a lot for a lot of things to do this :  </p>
  
  <pre><code>inputSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() {
       @Override
       public boolean onEditorAction(TextView exampleView, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_SEARCH ||
                  actionId == EditorInfo.IME_ACTION_DONE ||
                      event.getAction() == KeyEvent.ACTION_DOWN &amp;&amp;
                          event.getKeyCode() == KeyEvent.KEYCODE_ENTER) { 
                               //do something
            }
            return true;
        }
  }); 
  </code></pre>
  
  <p>But when I do this with all of this conditions, my app crash and output me this in logcat:  </p>
  
  <pre><code>05-05 15:56:05.195: E/View(26569): hasTransientState decremented below 0: unmatched pair of setHasTransientState calls
  05-05 15:56:05.195: W/dalvikvm(26569): threadid=1: thread exiting with uncaught exception (group=0x417fde48)
  05-05 15:56:05.195: E/AndroidRuntime(26569): FATAL EXCEPTION: main
  05-05 15:56:05.195: E/AndroidRuntime(26569): Process: com.myapp PID: 26569
  05-05 15:56:05.195: E/AndroidRuntime(26569): java.lang.NullPointerException
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at com.myapp.SomeFragment$3.onEditorAction(SomeFragment.java:148)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at android.widget.TextView.onEditorAction(TextView.java:4395)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at com.android.internal.widget.EditableInputConnection.performEditorAction(EditableInputConnection.java:138)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:297)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:77)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at android.os.Handler.dispatchMessage(Handler.java:102)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at android.os.Looper.loop(Looper.java:136)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at android.app.ActivityThread.main(ActivityThread.java:5105)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at java.lang.reflect.Method.invokeNative(Native Method)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at java.lang.reflect.Method.invoke(Method.java:515)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
  05-05 15:56:05.195: E/AndroidRuntime(26569):    at dalvik.system.NativeStart.main(Native Method)  
  </code></pre>
  
  <p>And when I keep only the <code>actionId == EditorInfo.IME_ACTION_DONE</code> in conditions the app does not crash, but does not do anything, and logcat output only this :</p>
  
  <pre><code> 05-05 15:56:05.195: E/View(26569): hasTransientState decremented below 0: unmatched pair of setHasTransientState calls
  </code></pre>
  
  <p>I have searched on Google but didn't find something convincing for this very strange error for me.
  For me and others who maybe are going to face the same problems, I would like some help on this one :)</p>