• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

android.provider.CallLog.Calls.DATE not working as expected

Hi,

I'm new to android development. I was writing an app which includes reading all call logs and comparing the call date with System.currentTimeMillis().

What I'm doing is I'm taking difference between System.currentTimeMillis() and call date (of one of the entry ). The difference value shows as expecetd in the emulator but when I try to run the same app on the phone [ htc desire hd with android 2.3.3 ], it behaves strangely.

When I further checked I found that the call date is not being logged correctly. For example if I make a call and within a minute if I try to compare that call date with System.currentTimeMillis(), the difference is shown huge. Almost more than hours !.

Can anyone let me know what the problem is. Or any other way how I can achieve the logic I mentioned.

Thanks in advance :)
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones