If LOCKED_STATE = False Then
Dim td As TimeDialog
Dim huidige=lEttape.get(params.LastKnown) As Ettape
td.Is24Hours = True
If params.LastKnown > 0 Then
Log (huidige)
If huidige.rusttijd.Length < 5 Then huidige.rusttijd = 0 & huidige.rusttijd
Log (huidige)
td.Hour = huidige.rusttijd.SubString2(0,2)
td.Minute = huidige.rusttijd.SubString2(3,5)
If td.Show("Pauze","","ok","cancel","",Null) = DialogResponse.POSITIVE Then
Log (huidige)
huidige.rusttijd= NumberFormat(td.Hour,2,0) & ":" & NumberFormat(td.Minute,2,0)
huidige.Vertrek = DateTime.TIME(DateTime.TImeParse(huidige.Aankomst)+ DateTime.TimeParse(huidige.rusttijd))
lEttape.Set(params.LastKnown, huidige ) ''write in list
Log (huidige)
CalculateEtappes(True)
UpdatePanel1(params.LastKnown)
End If
End If
End If
Its indeed landscape. I was trying to reuse and old app I made and the dialog box showed up empty. It used to work perfectly.What is the device orientation? It should be portrait.
Sub Activity_Click
Dim td As TimeDialog
td.TimeTicks = DateTime.Now
Dim sf As Object = td.ShowAsync("", "Select time", "Yes", "", "Cancel", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
Log(DateTime.Time(td.TimeTicks))
End If
End Sub
It is a bug in some Android versions. I've tested it with Android 8 and it works fine in landscape mode.
Tested with this code:
B4X:Sub Activity_Click Dim td As TimeDialog td.TimeTicks = DateTime.Now Dim sf As Object = td.ShowAsync("", "Select time", "Yes", "", "Cancel", Null, False) Wait For (sf) Dialog_Result(Result As Int) If Result = DialogResponse.POSITIVE Then Log(DateTime.Time(td.TimeTicks)) End If End Sub
Worth testing it with and without a title.