Android Question B4XFloatTextField how to set label by code

Gianni Sassanelli

Active Member
Licensed User
Longtime User
Hi i need to set at runtime the label of B4XFloatTextField
i have tried the some code of FloatLabeledEditText but unsuccessfully

Can i have help please?
tks

B4X:
' ... partial code used

Sub Class_Globals
    Private Root             As B4XView 'ignore
    Private xui             As XUI 'ignore
    Private fldNome         As B4XFloatTextField
End Sub 
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("lay_test")
    Dialog.Initialize(Root)
  Dim jo As JavaObject = fldNome.mBase
   Dim r As Reflector
   r.Target = jo
   Dim lbl As Label = r.GetField("mHintTextView")
   fl.EditText.HintColor = Color
   lbl.TextColor = Color
end Sub


(RuntimeException) java.lang.RuntimeException: Object should first be initialized (ResultSet).
Error occurred on line: 107 (B4X_pgNucleoFamigliare_Detail)
java.lang.NoSuchFieldException: No field mHintTextView in class Lanywheresoftware/b4a/B4AClass$ImplB4AClass; (declaration of 'anywheresoftware.b4a.B4AClass$ImplB4AClass' appears in /data/app/it.techservice.dogmapp-1/base.apk)
at java.lang.Class.getDeclaredField(Native Method)
at anywheresoftware.b4a.agraham.reflection.Reflection.GetField(Reflection.java:316)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at it.techservice.dogmapp.b4x_pgnucleofamigliare_detail._cmbspecie_selectedindexchanged(b4x_pgnucleofamigliare_detail.java:633)
at it.techservice.dogmapp.b4x_pgnucleofamigliare_detail._pg_bound_recordsource(b4x_pgnucleofamigliare_detail.java:124)
at it.techservice.dogmapp.b4x_pgnucleofamigliare_detail._b4xpage_appear(b4x_pgnucleofamigliare_detail.java:82)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
 
Top