views:

84

answers:

1

I have a separate class that includes the database, a cursor, and all the accessor methods for database information. I import the cursor into all the classes that update or use the database. However, I get a runtime error whenever I try to start an intent that uses the database. Any ideas on what might be happening?

+1  A: 

You can't access the database from another application, what you should do is create a ContentProvider if you want to expose this data to other apps.

If you're trying to access it from within your application, create a wrapper DBHelper kinda class that access the SQLLite db, and have this be the ONLY class in your app touching the database directly, then expose methods to select, update, delete, etc. Other classes don't need to know about the database, they just deal with the DBHelper class and Java objects.

Ricardo Villamil