Android Question java.lang.Exception Error

Pencil3

Member
Licensed User
Attempting to get Date & Time for a sqlite entry. Using the below I receive an error:

An error occurred:
(Line: 0) End Sub
java.lang.Exception: Sub date_ondateset signature does not match expected signature.

B4X:
Sub Date_onDateSet(year As Int, monthOfYear As Int,    dayOfMonth As Int, hour As Int, minute As Int, second As Int)
    Log($"onDateSet(${year},${monthOfYear},${dayOfMonth},${hour},${minute},${second})"$)
    Dim d As Long
   
    DateTime.DateFormat = "yyyy-MM-dd HH:mm:ss"
    d = DateTime.DateParse(year&"-"&(monthOfYear+1)&"-"&dayOfMonth&" "&hour&":"&minute&":"&second)
   
    A01DateValEditText.Text = DateTime.Date(d)
       
End Sub
 

stevel05

Expert
Licensed User
Longtime User
How are you calling Sub Date_onDateSet? you should be providing 6 parameters all of type int. That error usually means that there is something wrong with the data you are providing.
 
Upvote 0
Top