How to override a specific method in android activity?

11 views
Skip to first unread message

Hasni Faiçal

unread,
Oct 22, 2019, 6:20:13 AM10/22/19
to CodenameOne Discussions
I need to override dispatchTouchEvent function in android to integrate an SDK to track users behaviors. I cannot find this documented.

If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device

Shai Almog

unread,
Oct 22, 2019, 9:32:15 PM10/22/19
to CodenameOne Discussions
We'll add the build hint android.activityClassBody for the next update this Friday. It will let you define something like:

android.activityClassBody=public boolean dispatchTouchEvent(android.view.MotionEvent  ev)  { myCodeThatINeed(); return super.dispatchTouchEvent(ev); }
android.activityClassImports=import class1; import class2;
Reply all
Reply to author
Forward
0 new messages