Android Question Problem with altered B4XPreferencesDialog.b4xlib

RB Smissaert

Well-Known Member
Licensed User
Longtime User
Have an altered B4XPreferencesDialog.b4xlib that has always worked perfectly fine (for several years), but now I got a problem when clicking a numeric text box:

Error occurred on line: 0 (B4XFloatTextField)
java.lang.Exception: Sub b4xfloattextfield1_focuschanged signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject b4a.exampleljjll.preferencesdialog_subs_0._b4xfloattextfield1_focuschanged(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
class anywheresoftware.b4a.pc.RemoteObject, class anywheresoftware.b4a.pc.RemoteObject,

I attach the file with the altered B4XPreferencesDialog.

This is how it is used in a B4X page class:

B4X:
Private Sub PrefDialog_IsValid(TempData As Map) As Boolean
    
    Dim number As Int = TempData.GetDefault("NumberToValidate", 0)
    
    If number < 10 Or number > 20 Then
        prefdialog.ScrollToItemWithError("NumberToValidate")
        Return False
    End If
    
    Return True
    
End Sub

'-------------------------------------------------------------------------------------------------------------
'Note here we have vTextField from Preferences dialog library as XUIViews library was changed to supply this!!
'-------------------------------------------------------------------------------------------------------------
Private Sub PrefDialog_TextFieldClicked(vTextField As B4XView)
    
    'vTextField.Tag will hold an Int array:
    'at arr(0): Enums.eEditText.PreferencesDialogTextField(34)
    'at arr(1): Type tPreferenceDialogItem (iText ,iDate ,iColor, iNumber, iDecimalNumber, iMultilineText etc.)
    'Dim arr() As Int = vTextField.Tag
    'Log("PrefDialog_TextFieldClicked, vTextField.Tag: " & arr(0) & ", " & arr(1))
    
    '------------------------------------------------------------------------------
    'this is needed to get a new text field if the keyboard was already visible
    'note clicking in the same text field won't trigger this event, so that is good
    '------------------------------------------------------------------------------
    cMP.HideKeyboard
    
    'this is used to put the keyboard top or bottom, not to cover the vTextField
    '---------------------------------------------------------------------------
    Dim iYPos As Int = vTextField.Parent.Parent.Parent.Top
    Dim iScrollPosY As Int = prefdialog.CustomListView1.sv.ScrollViewOffsetY
    Dim iYPosReal As Int = iYPos - iScrollPosY
    
    vSelectedTextField = vTextField
    
    SetOptionsCustomKeyboard(vTextField)
    
    cMP.iFocussedEditText = Enums.eEditText.PreferencesDialogTextField
    cMP.SetKeyboard(vTextField, iYPosReal, False)
    
End Sub

Any assistance to solve this would be greatly appreciated.

RBS
 

Attachments

  • PreferencesDialog.bas
    36.6 KB · Views: 3
Top