SQLite average for SQLite retrieved / passed as int value

I have a column INTEGERin my database table and saved a value for it 1476355625598(by updating an existing row).

When I immediately check the value by running the query, I get the same, true, value 1476355625598.

However, when my IntentService later retrieves the value, it returns the value -1113124226.

I checked, and -1113124226this is the same value as you typed (int)1476355625598.

I have added debug output to all my lines of code that modify this column, and can confirm that I have no other database operations that update the value.

So, it seems like something is throwing my long one at int ... Any ideas how / why this could be happening?

NB. The value I save is the timestamp (millis format), which is preferable to save in string format.

UPDATE

Since my database is accessible through the content provider, I added a content observer to my MyApplication class. It does not report any other updates to this table.

UPDATE # 2

Now the problem is resolved. See Comment ...

+4
source share
1 answer

The OP will find its mistake before I have time to write this, but I will post it anyway to close it. OP can add its own if it wants (no hard feelings;)) (This will allow others to spam later to get a repeat point ...)

, . INTEGER, long , getLong(int) getLong(String). , JAVA .

, OP POST: fooobar.com/questions/1657605/...

, . getInt getLong NUMERIC SqliteType.

+1

Source: https://habr.com/ru/post/1657604/


All Articles