2

1)In android source code which file will set time in notification bar ? If anybody worked/know that file please let me know, i have to compare the time showing in notification bar and the current time.

2)And how the time will be updating each sec or minute.. i mean, how the time gets updated evey minute in notification bar. Is there any intent will say the time updated now or is there any code which will update by itself once initially we set the time?

Thanks for your time.

Vins
  • 4,089
  • 2
  • 35
  • 50

2 Answers2

1

try this System.currentTimeMillis(); this is system timer which updates the time

Mudasar
  • 249
  • 1
  • 5
  • 15
  • This will give the current time , but i dont think the time which is been in notification bar... Ofcourse the both time will be same always..But my case is different where i need to compare the time in notification bar and the system time. – Vins Jan 11 '12 at 11:34
1

1) Clock.java

2) By using TIME_TICK BroadcastReceiver. Which normal apps cannot register.

Vins
  • 4,089
  • 2
  • 35
  • 50
  • Yes, they can (normal apps can register the TIME_TICK BroadcastReceiver) - http://developer.android.com/reference/android/content/Intent.html#ACTION_TIME_TICK – TechAurelian May 06 '14 at 13:23