Note that getLocalContentProvider is API level 5.
Thanks for the information!! I didn't pay attention to this... :p
I will use the static as you suggested!
Thanks for all time passed to discuss with me.
--
You received this message because you are subscribed to the Google
Groups Android
Hi,
For a new application I try to make weekly data update by downloading
directly an SQLite file generated in PHP.
So when update is needed I:
- Download the new SQLite file in ZIP (mydb.zip)
- Extract to a temporary file (mydb.db)
- Delete the old one (application.db via
What's probably happening is that you are not closing the old database
file, so the application continues to read from it, and not from the new
one.
This is entirely possible on Linux (and other Unixes): deleting an open
file is allowed, the applications don't notice, and the actual file data
07.08.2011 17:11, MARTIN Nicolas пишет:
Thanks for your answer.
A possibly complicated solution would be to close the old database
file using SQLiteOpenHelper.close, and then open the new one.
I also try using SQLiteOpenHelper.close (which is a synchronized
method) and open the new
Thanks for your answer.
A possibly complicated solution would be to close the old database file
using SQLiteOpenHelper.close, and then open the new one.
I also try using SQLiteOpenHelper.close (which is a synchronized method) and
open the new one but same problem...
As for me, I would do this:
Well, something is not working :) Possibly something, somewhere, is keeping
references to the old SQLiteDatabase object that in turn still references
the old file.
That is what I think but where between: Content provider | CursorLoader |
CursorAdapter | something else...
If your server
07.08.2011 17:53, CocoRambo пишет:
All case, I am really want to understand the actual behavior
At this point, I would copy the source for SQLiteOpenHelper into the
project (changing the package name, of course) and debug into its close
and open...
--
Kostya Vasilyev
--
You received this
It doesn't seem bad to me at all.
Note that getLocalContentProvider is API level 5.
If this was my code, I'd take advantage of the provider being local, and
keep a reference to the database somewhere (in a static variable). The
provider would use this static to access the database.
In the
I finally find a solution but I am not proud of it...
My mistake was that I called close() on the wrong SQLiteOpenHelper.
So I add a public method to my ContentProvider to get his
SQLiteOpenHelper...
Next during update I do this:
MyContentProvider cp = (MyContentProvider)
9 matches
Mail list logo