OZONE Asylum
Forums
Server-Side Scripting - Oh my!
ANDROID SQLLite problems
This page's ID:
32064
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Hi I have started to learn android developement. So i started creating a little app that uses a sqlLite DB I had all my DB accesses scattered around my app so i decided to create aDBHandler class to have it all in one place. Now i get following error: 12-06 21:30:35.250: ERROR/AndroidRuntime(183): java.lang.RuntimeException: Unable to start activity ComponentInfo{my.helloWorld/my.helloWorld.selectGroups}: android.database.sqlite.SQLiteException: unable to open database file old Code:(Worked fine) [code]private void some_function() { myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);[/code] new Code:(Throws above error) [code]public class DBHandler{//threadsafe singleton . . private static DBHandler instance; . . public static synchronized DBHandler getInstance() { if (DBHandler.instance == null) { DBHandler.instance = new DBHandler(); instance.myDB = android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(MY_DB_NAME, null); } return DBHandler.instance; } [/code] has anyone got an idea why i cannot access my db from this class? am i missing something here? thanks for the help [small](Edited by [url=http://www.ozoneasylum.com/user/1746]Blacknight[/url] on 12-06-2010 21:37)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail