Problem with SQL and Android 4.03

D

Deleted member 103

Guest
hi,

my Contact-App works with Android 2.2 and Android 2.3 Problems without.
For devices with Android 4.03 I get this error message:
HTML:
java.lang.RuntimeException: Unable to resume activity {fg.phone4all/fg.phone4all.main}: android.database.StaleDataException: Attempted to access a cursor after it has been closed.


   at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2444)
   at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2472)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1173)
   at android.os.Handler.dispatchMessage(Handler.java:99)
...
...

Someone knows the problem and how can I fix it?


Ciao,
Filippo
 

timo

Active Member
Licensed User
Longtime User
Not sure, but if you correctly managed 'open/close' cursors, it is possible that the use of a 'db.close' command somewhere gave you this problem on new OS. You can test it trying not to utilize a db.close command, if you used it, and see if it works on 4.03. Maybe it is not only the cursor which is closed, but the db itself.
 
Last edited:
Upvote 0
D

Deleted member 103

Guest
Ciao timo,

Not sure, but if you correctly managed 'open/close' cursors, it is possible that the use of a 'db.close' command somewhere gave you this problem on new OS. You can test it trying not to utilize a db.close command, if you used it, and see if it works on 4.03. Maybe it is not only the cursor which is closed, but the db itself.
Thanks for the reply.

I now have all the line "cursor.Close" disabled, the error message comes nonetheless.
What else can I do?

Ciao,
Filippo
 
Upvote 0

timo

Active Member
Licensed User
Longtime User
I don't know if b4a can differentiate between managed and unmanaged cursors, however, I have had some problems with the 'db.clode' command (not cursor.close command), that's why I thought the problem could be there. Anyway, now I newer close a DB (but cursors yes). Can you tell me if you usually use the db.close command?
 
Upvote 0
D

Deleted member 103

Guest
Il problema non è in B4A ma nella mia Library-fgContacts e penso pure nella Phone-Library(però non ho provato).
Ogni volta che si accedde a un contatto viene usata la funzione cursor.close.
Questa funzione non deve essere più usata a partire da Android 4.


The problem is not in B4A but in my Library fgContats-Library and I think also Phone-Library (though I have not tried).
Each time you accedde to a contact function is used cursor.close.
This function should not be used any longer from Android 4.
 
Upvote 0
Top