Android Question AnotherDatePicker Value Doesn't Set in SetDate()

Richard Goh

Active Member
Licensed User
Longtime User
Hi,

I was trying to set the AnotherDatePicker value using below code in Activity_Create. When try to get the value using adpDate.GetDate (without doing any date select from the calendar). The value is empty. Seems like it wasn't set until I do a select date from the calendar. Is it a bug? Any advice is highly appreciated.

B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("myLayout") 
    adps = Array(adpDate) 
    adpDate.SetDate(DateTime.DateParse(Main.SelectedDate),True)
end sub

Thank you.
 

Rubsanpe

Active Member
Licensed User
Bug? What behavior were you expecting? Until you select a date the events of the control are not executed to obtain the selected date. Until then the result is empty, just as if you had clicked on the cancel button.

Rubén
 
Upvote 0

Richard Goh

Active Member
Licensed User
Longtime User
Hi Rubsanpe,

Thanks for your reply.

Fyi, the adp is for records selection purpose and the date value is from another caller activity. This adp selection activity will first set the date value from caller when it's called and then execute a db selection prior to any adp date selection action. Subsequently the adp can be select for another date and it's working very well on that after performing manual adp selection. By right the adp value should be set whenever the SetDate function is performed. It's shouldn't wait for any manual selection action to be performed only set the actual value.

Thanks.
 
Upvote 0
Top