Android Question Display date and time on activity title.

hub73

Active Member
Licensed User
Longtime User
Hello !
How could i display and update the time (and the date) on the activity.title ?
Many thanks !
 

Mahares

Expert
Licensed User
Longtime User
works fine with timer. Thanks !
It looks like you got it, but here it is in case you want to compare or someone else wants some help

B4X:
Dim MyTimer As Timer  'in Process_Globals

MyTimer.Initialize("MyTimer", 1000 * 60)  'in Activity_Create  update every minute or whatever

Sub Activity_Resume
  MyTimer.Enabled=True
End Sub

Sub Activity_Pause (UserClosed AsBoolean)
  MyTimer.Enabled=False
End Sub

Sub MyTimer_Tick
  Activity.Title=DateTime.Date(DateTime.Now) & "  "  & DateTime.Time(DateTime.Now)
End Sub
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top