Android Question App crash when using AS_Datepicker and AS_DatePicker1_CustomDrawDay function

alyami

Member
Licensed User
Hello,

AS_Datepicker is a wonderful work specially the ability to add images to day box, but after using AS_DatePicker1_CustomDrawDay function the App Crash troughing this message

Regards for help
 

Attachments

  • Screenshot 2025-05-29 134935.png
    Screenshot 2025-05-29 134935.png
    47.4 KB · Views: 28

alyami

Member
Licensed User
This is the code used

Private Sub AS_DatePicker1_CustomDrawDay (Date As Long, Views As ASDatePicker_CustomDrawDay)
Views.xlbl_Date.Height = 25dip

If DateTime.GetDayOfMonth(Date) = 7 Then

Dim xiv As B4XView = CreateImageView("")
Views.BackgroundPanel.AddView(xiv,0,Views.xlbl_Date.Height,Views.BackgroundPanel.Width,Views.BackgroundPanel.Height - Views.xlbl_Date.Height)
xiv.SetBitmap(xui.LoadBitmapResize(File.DirAssets,"a.png",xiv.Width,xiv.Height,True))

End If

End Sub
Private Sub CreateImageView(EventName As String) As B4XView
Dim iv As ImageView
iv.Initialize(EventName)
Return iv
End Sub
 
Upvote 0

alyami

Member
Licensed User
Thank you Alexander,
Please find attached the project

Kindly notice the slowness , and after second time of selecting a date the App crash, I used the same code from the example you posted
 

Attachments

  • AS_DatePicker.b4xlib
    11.8 KB · Views: 29
  • DatePicker.zip
    147.6 KB · Views: 32
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Thanks to Github, I was able to identify the error. In V1.30 I did bugfixing and accidentally created a loophole when using the CustomDrawDay event.

This should be fixed now, but I still need to look at it again, as this change had a purpose that I still need to identify.
 

Attachments

  • AS_DatePicker.b4xlib
    11.8 KB · Views: 28
Upvote 0
Top