Hey there,

I've just started Android development so this might be a somewhat dumb
mistake. Anyway, I'm trying to create a SQLiteDatabase and and access
from one of my app's widgets. I'm able to create the database, but
whenever I try to open it somewhere else I get an "unable to open
database file" exception. Is there reason for this? Here's what I'm
trying:

mDatabase = openOrCreateDatabase("preferences.db",
SQLiteDatabase.CREATE_IF_NECESSARY, null);
try { mDatabase.execSQL(CREATE_QUERY); } catch (SQLiteException e) {}
mDatabase.close();

mDatabase = SQLiteDatabase.openDatabase("preferences.db", null,
SQLiteDatabase.OPEN_READWRITE);
mDatabase.close();

Thanks for taking a look!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to