Skip to content Skip to sidebar Skip to footer

Nativeactivity Override Onkeydown()

I having problem with a NativeActivity subclass I am working on, my goal would be to catch and handle key events from the Java code instead of native code (this is mainly due beca

Solution 1:

add implements KeyEvent.Callback

public class @activity@ extendsNativeActivityimplementsKeyEvent.Callback  {
   publicbooleanonKeyMultiple(int keyCode, int count, KeyEvent event)
}

KeyEvent.Callback overrides happen after the native AInputEvent dispatching though; so basically you'll have to ignore all old dipatching and implement something new if you want to get the extended keys like ÷,√,€,£, …

Post a Comment for "Nativeactivity Override Onkeydown()"