Note the separate download for an updated Dialogs2 class that fixes a bug in the original. I wrote the original Dialogs library many moons ago and it has suffered with age owing to the changes made to Android and B4A over the years despite the administrations of several other people. Although...
Those dialogs are rather nice. They are lightweight, and work rather well.
So, you need to place:
B4X:
Dialogs2.xml
Dialogs2.jar
Into your libraries path. Then in windows->Libraries Manger, add this:
And thus your code is now:
B4X:
Dim MyTimePop As TimeDialog
MyTimePop.TimeTicks = DateTime.Now
Dim MyDialog As Object = MyTimePop.ShowAsync("", "Pick The Time", "Ok", "Cancel", "", Null, True)
Wait For (MyDialog) Dialog_Result(ret As Int)
If ret = DialogResponse.POSITIVE Then
ToastMessageShow("Time selected = " & MyTimePop.Hour & ":" & MyTimePop.Minute,True)
End If
And you see this:
I don’t know if “wait for” can be used here (edit: yes, of course it can!!!)
But, as a library that uses “standard” android widgets that is easy, lightweight and works well? I like this choice.
Often the problem with B4A? Well, you have SO MANY choices - the trick is to find some approach and then stick with it until such time one finds a better alternative.
Regards,
Albert D. Kallal
Edmonton, Alberta Canada
Yes you can. That's the reason for the update from the original Dialogs library. Look at the demo. There are sync and async versions of each Dialog. Using the sync versions is not recommended with present and future versions of Android
I updated my code to reflect this (best to encourage the good road here).
In fact, I looked at the download I have from last year - and it MOST certainly did/does have the wait/for.
And even my "test" of that dialog in the same folder also used wait for.
Regardless - I have updated my post here to reflect that.
And I still dare say that the simple use, the simple code and how it produces the "standard" Android date picker, and also the time picker make this library choice near tops in IMHO.
Thank you for the follow up.
Regards,
Albert D. Kallal
Edmonton, Alberta Canada