Android 7.0: EditText invalid actionId in actionlistener editor

I have an edit text declared in xml like this with the following properties and I set android:imeOptions="actionNext"

<EditText
    android:id="@+id/ui_row_create_poll_edit_text_txt_name"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_marginLeft="@dimen/margin_normal"
    android:layout_toLeftOf="@id/ui_row_create_task_user_info"
    android:background="@android:color/transparent"
    android:paddingBottom="@dimen/padding_large_plus_little"
    android:paddingLeft="@dimen/padding_large_plus_little"
    android:paddingTop="@dimen/padding_large_plus_little"
    android:singleLine="true"
    android:maxLength="@integer/task_length"
    android:imeOptions="actionNext"
    android:textColor="@color/black"
    android:textSize="@dimen/font_very_large"/>

In the code, I added the actionlistener editor this way.

 public boolean onEditorAction(TextView v, int actionId, KeyEventevent{
    if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) {
        listener.onActionDone(option, etOption);
    }

At Api <24, I get actionIdboth EditorInfo.IME_ACTION_NEXTand it works great. but when I run my application on Android 7.0, I get actionIdhowEditorInfo.IME_ACTION_IME_ACTION_UNSPECIFIED

enter image description here

Can someone please indicate why I get different actions in Api-24. If there are any changes to editText in Android 7.0, please point me to some links. Thank.

Note. My editText is placed on the watchlist

+4
source share

Source: https://habr.com/ru/post/1656310/


All Articles