OnEditorActionListener called twice with same eventTime on SenseUI keyboard
<p>On just one phone I am testing on (HTC Incredible, Android 2.2, Software 3.21.605.1), I am experiencing the following behavior.</p>

<p>The onEditorAction event handler is being called twice (immediately) when the Enter key on the Sense UI keyboard is pressed.</p>

<p>The KeyEvent.getEventTime() is the same for both times the event is called, leading me to this work-around:</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) {
    [...]

    EditText text = (EditText)findViewById(R.id.txtBox);
    text.setOnEditorActionListener(new OnEditorActionListener() {
        private long lastCalled = -1;

        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if ( event.getEventTime() == lastCalled ) {
                return false;
            } else {
                lastCalled = event.getEventTime();
                handleNextButton(v);
                return true;
            }
        }
    });

    [...]
}
</code></pre>

<p>The EditText is defined as:</p>

<pre><code>&lt;EditText 
    android:layout_width="150sp" 
    android:layout_height="wrap_content"
    android:id="@+id/txtBox" 
    android:imeOptions="actionNext"
    android:capitalize="characters" 
    android:singleLine="true"
    android:inputType="textVisiblePassword|textCapCharacters|textNoSuggestions"
    android:autoText="false" 
    android:editable="true" 
    android:maxLength="6"
/&gt;
</code></pre>

<p>On all other devices I've tested on, the action button is properly labeled "Next" and the event is only called a single time when that button is pressed.</p>

<p>Is this a bug in Sense UI's keyboard, or am I doing something incorrectly?</p>

<p>Thank you for any assistance.</p>

<hr>

<p>Updated - thanks to the answers given, I have settled on the following as my checks. This works fine on both of the phones I have available to test (Sense UI and Cyanogenmod CM7)</p>

<pre><code>            if (event != null &amp;&amp; event.getAction() != KeyEvent.ACTION_DOWN) {
                return false;
            }

            if ( actionId != EditorInfo.IME_ACTION_NEXT &amp;&amp; actionId != EditorInfo.IME_NULL ) {
                return false;
            }
</code></pre>
