How to send key event to an edit text

前端 未结 10 2244
醉酒成梦
醉酒成梦 2021-02-07 20:43

For example, send a backspace key to the edit text control to remove a character or send a char code like 112 to append a character in the edittext control programmatically.

10条回答
  •  清酒与你
    2021-02-07 21:37

    virsir , I suppose you are looking for dispatching hard keys programmatically.

    For that you may try dispatch (KeyEvent.Callback receiver, KeyEvent.DispatcherState state, Object target) with an example at Back and other hard keys: three stories

    Hope that helps.

提交回复
热议问题