Android Question TimeDialog under Android 6 (API23) - empty

peacemaker

Expert
Licensed User
Longtime User
HI, All

Under Android 5.1.1 - TimeDialog is still OK.
But not under Android 6.
Lib v.2.92.
 

Attachments

  • 5.1.1.png
    5.1.1.png
    104.8 KB · Views: 604
  • 6.0.png
    6.0.png
    76.8 KB · Views: 665
Last edited:

Marc De Loose

Member
Licensed User
Longtime User
I have a similar problem and have no clue how to solve it: I am on the latest version and android 7 this is the code.
THe dialog shows as in the above post:

Any help how to rewrite it so it works is appreciated. thx

B4X:
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
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
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.
 
Upvote 0

Marc De Loose

Member
Licensed User
Longtime User
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.

YES YES I changed the platform path to android-8 and the targetSDK in the manifest to 8 and BOOM it worked as it always was. In landscape.
THX for the help!!
 
Upvote 0
Top