5

I'm currently using a Samsung Galaxy Tab P1000, and I'm stuck in a problem that I don't know for sure if happens in all smartphones. When synchronizing the GPS, everytime I get the location.getTime(); it returns the actual date plus 1 day. Am I doing something wrong or is this a bug?

Here is the code:

@Override
    public void onLocationChanged(Location location) {
        setRealTime(location.getTime()); 
        ...
        data = new Date();
        data.setTime(getRealTime());
    }

And then for example, it today is 15:31 01/16 it shows 15:31 01/17

The Problem is exclusively in the Samsung Galaxy Tab P1000...

any ideas?

Andre Mariano
  • 308
  • 1
  • 3
  • 14
  • You haven't shown what you're doing or how you've diagnosed the problem. Can you give a sample of what's being returned and when (including your time zone)? – Jon Skeet Jan 16 '12 at 17:22
  • maybe something wrong is in your own functions. Try use Log.d("checktime", (new Date(location.getTime())).toString() to check it? – guinny Jan 16 '12 at 17:55
  • Today I'm going to test it on a HTC Desire – Andre Mariano Jan 17 '12 at 10:57
  • Dammit, the test in the HTC Desire worked fine, showing the right date, but the Galaxy Tab is showing the current date + 1 day. – Andre Mariano Jan 17 '12 at 16:24

1 Answers1

4

This is a leap year bug in Samsung firmware, confirmed by Samsung. See Android : Samsung Galaxy Tabs and Android 2.2 Devices Showing GPS date 1 Day Advance from 1st jan 2012

That answer shows some code which works around it; short version is to use an NmeaListener instead of a LocationListener. And it may fix itself on Feb 29th...

Community
  • 1
  • 1