I've searched and searched and I can't seem to catch a press on the "arrow" key on the android EditText keyboard. For me, it's the button right underneath the backspace that looks like an arrow.
I have tried using:
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
System.out.println(actionId);
if (event.getAction() != KeyEvent.ACTION_DOWN) {
System.out.println("event.getAction() != KeyEvent.ACTION_DOWN");
return false;
}
if (actionId == EditorInfo.IME_ACTION_NEXT) {
System.out.println("keyCode == KeyEvent.FLAG_EDITOR_ACTION");
trialNumber++;
trialNumberTextView.setText("Trial" + Integer.toString(trialNumber));
return true;
}
System.out.println("false");
return false;
}
});
EditText:
<EditText
android:id="@+id/sack_edit_text"
android:textSize="30dp"
android:textAlignment="center"
android:hint="@string/trial_hint"
android:layout_centerInParent="true"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:digits="0123456789."
android:maxLength="2"/>
But nothing is printed out at all when I click the arrow button. This works for the digits on the keyboard however. I have tried changing the arrow button to a Done button in the EditText xml, but that doesn't work either. Does anyone know why this is?