android - onEditorAction is not called for multi line EditText -
hi listen oneditoraction
event edittext
whatever reason.
it should 3 lines tall edittext have:
android:minlines="3"
in it's xml definition.
however if add:
android:inputtype="text"
the edittext appears single line edittext instead of 3 lines.
however must use android:inputtype="text"
because if remove oneditoraction
event never fired.
im stuck.
so question how achive following:
i need 3 line tall edittext capturing oneditoraction
event?
so far can followings:
- have edittext 3 lines without triggering
oneditoraction
or
- have edittext 1 line triggers
oneditoraction
xml files , code self-explanatory:
<edittext android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:ems="10" android:inputtype="text" android:minlines="3" android:gravity="left" android:id="@+id/answer_edit" />
code:
answeredit.setoneditoractionlistener(this);
...
@override public boolean oneditoraction(textview textview, int actionid, keyevent event) { toast.maketext(getcontext(), "working!", toast.length_long).show(); if (actionid == editorinfo.ime_null && event.getaction() == keyevent.action_down) { toast.maketext(getcontext(), "action down!", toast.length_long).show(); } return true; }
Comments
Post a Comment