J Jerryk Active Member Licensed User Longtime User Dec 2, 2022 #1 B4X: Dim ref As Reflector ref.Target = eWord ref.RunMethod2("setImeOptions", 4, "java.lang.int") When I declare eWord as EditText, the program adjusts the keyboard as I want. When I declare eWord as B4X objects: B4XFloatTextField or AS_TextFieldAdvanced the program crashes. Error occurred on line: 28 (pEdit) java.lang.NoSuchMethodException: java.lang.Object.setImeOptions [int] at java.lang.Class.getMethod(Class.java:2103) at java.lang.Class.getDeclaredMethod(Class.java:2081) at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:214) at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod2(Reflection.java:817) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146) at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262) at cz.flashcards3.pedit._b4xpage_created(pedit.java:67) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318) at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285) at java.lang.reflect.Method.invoke(Native Method) ....... Can setImeOption be used for these objects? How can this be solved?
B4X: Dim ref As Reflector ref.Target = eWord ref.RunMethod2("setImeOptions", 4, "java.lang.int") When I declare eWord as EditText, the program adjusts the keyboard as I want. When I declare eWord as B4X objects: B4XFloatTextField or AS_TextFieldAdvanced the program crashes. Error occurred on line: 28 (pEdit) java.lang.NoSuchMethodException: java.lang.Object.setImeOptions [int] at java.lang.Class.getMethod(Class.java:2103) at java.lang.Class.getDeclaredMethod(Class.java:2081) at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:214) at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod2(Reflection.java:817) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146) at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262) at cz.flashcards3.pedit._b4xpage_created(pedit.java:67) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318) at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285) at java.lang.reflect.Method.invoke(Native Method) ....... Can setImeOption be used for these objects? How can this be solved?
Erel B4X founder Staff member Licensed User Longtime User Dec 4, 2022 #2 You are confusing different things. B4XFloatTextField and AS_TextFieldAdvanced are custom views. It isn't related to B4X views. B4XFloatTextField exposes the native EditText with the TextField property. Code: B4XFloatTextField1.TextField.As(JavaObject).RunMethod("setImeOptions", Array(4)) Upvote 0
You are confusing different things. B4XFloatTextField and AS_TextFieldAdvanced are custom views. It isn't related to B4X views. B4XFloatTextField exposes the native EditText with the TextField property. Code: B4XFloatTextField1.TextField.As(JavaObject).RunMethod("setImeOptions", Array(4))