Android Question Preferences Dialog crashes on date select

Cosmo

Member
Hi all,
using B4A 12.8 I have a simple Preferences Dialog:

1758636786294.png


To get more space for the german 'Abbrechen' (what means Cancel) I set a listener:

B4X:
PrefDialog.SetEventsListener(Me,"PrefDialog")

At the event I fetch a reference for the buttons and set the distance:

B4X:
Private Sub PrefDialog_BeforeDialogDisplayed (Template As Object)
    
    Dim btnCancel As B4XView = PrefDialog.Dialog.GetButton(xui.DialogResponse_Cancel)
    btnCancel.Width = btnCancel.Width + 20dip
    btnCancel.Left = btnCancel.Left - 20dip
    Dim btnOk As B4XView = PrefDialog.Dialog.GetButton(xui.DialogResponse_Positive)
    btnOk.Left = btnOk.Left - 20dip

When the dialog opens everthing works fine (see scrennshot).

Clicking on the date (23.09.202) should open a date selection dialog.
But the app crashes, it runs again into PrefDialog_BeforeDialogDisplayed and there is no btnOk found.


1758637146510.png



Any suggestions do avoid this?

Second question, how to get a reference to the date label, to display the whole date? (Not 23.09.202)

Thanks in advance,
Bernhard
 

Cosmo

Member
Is there any suggestion for my second question: (please see screenshot above)

How to get a reference to the date label (to set the left distance), to display the whole date? (Not 23.09.202)

Thanks
Bernhard
 
Upvote 0
Top