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 !
 

hub73

Active Member
Licensed User
Longtime User
Thanks. Where to find info/doc about timer ? Perhaps i need to code my own ?
 
Upvote 0

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
Cookies are required to use this site. You must accept them to continue using the site. Learn more…