Hello I have this code:
and i try to read x y coordinates of a zooomable images but the code return this error :
in a B4XPages
Can help me ? Thanks in advances
B4X:
Sub imgViewPlanimetria_OnItemClick
Dim rTI As Reflector, rGD As Reflector
rTI.Target=imgViewPlanimetria
Dim mGD As JavaObject = rTI.GetField("mGestureDetector")
rGD.Target=mGD
Dim ptX As Object = rGD.GetField("mDownFocusX")
Dim ptY As Object = rGD.GetField("mDownFocusY")
Dim aPointObject As JavaObject = rTI.RunMethod4("transformCoordTouchToBitmap", _
Array As Object(ptX,ptY,False), Array As String("java.lang.float", _
"java.lang.float","java.lang.boolean"))
Dim x, y As Float
x = aPointObject.getfield("x")
y = aPointObject.getfield("y")
Log(x)
Log(y)
End Sub
B4X:
planimetria_touchimage_onitemclick (java line: 520)
java.lang.NoSuchFieldException: No field mDownFocusX in class Landroid/view/GestureDetector; (declaration of 'android.view.GestureDetector' appears in /system/framework/framework.jar!classes2.dex)
at java.lang.Class.getDeclaredField(Native Method)
at anywheresoftware.b4a.agraham.reflection.Reflection.GetField(Reflection.java:316)
at com.app.regant.planimetria._touchimage_onitemclick(planimetria.java:520)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA$1.run(BA.java:352)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Can help me ? Thanks in advances