https://developer.android.com/refer...html#setStrokeCap(android.graphics.Paint.Cap)
This page shows it's a valid method for the paint object, so I tried
but I got:
Also, I'm assuming the values of the enum. Is there a way to get the real values?
This page shows it's a valid method for the paint object, so I tried
B4X:
'CapType: 0=Butt, 1=Round, 2=Square (assumed)
Sub setStrokeCap(BG As Canvas, CapType As Int)
Dim r As Reflector
r.Target = BG
r.Target = r.GetField("paint")
r.RunMethod2("setStrokeCap", CapType, "java.lang.int")
End Sub
but I got:
graphics_setstrokecap (java line: 3915)
java.lang.NoSuchMethodException: setStrokeCap [int]
at java.lang.Class.getMethod(Class.java:624)
at java.lang.Class.getDeclaredMethod(Class.java:586)
at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:214)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod2(Reflection.java:817)
at com.omnicorp.scifiui.graphics._setstrokecap(graphics.java:3915)
at com.omnicorp.scifiui.omnipaint._drawlinelist(omnipaint.java:1962)
at com.omnicorp.scifiui.omnipaint._drawpoints(omnipaint.java:2232)
at com.omnicorp.scifiui.omnipaint._addpoint(omnipaint.java:391)
at com.omnicorp.scifiui.omnipaint._drawlayer_down(omnipaint.java:1746)
at com.omnicorp.scifiui.omnipaint._handleevent(omnipaint.java:5128)
at com.omnicorp.scifiui.macintosh._handleevent(macintosh.java:2842)
at com.omnicorp.scifiui.macintosh._handletouch(macintosh.java:3526)
at com.omnicorp.scifiui.lcar._mouseevent(lcar.java:8738)
at com.omnicorp.scifiui.lcar._gesturestouch(lcar.java:4840)
at com.omnicorp.scifiui.main._handledelayedtouch(main.java:2225)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1151)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
java.lang.NoSuchMethodException: setStrokeCap [int]
Also, I'm assuming the values of the enum. Is there a way to get the real values?