I'm having trouble opening a Database.I can get the DB to open and close and grab the data that I require in a Layout class and push it to a UI fine. But i also want to open the DB in the background and read the data as well(Not at the same time as the UI). I am having trouble doing this and get a error in the Helperclass I am calling the class like this:
GenerateFiringData GenData=new GenerateFiringData(); //Generate the firing data
and this is the class
import android.app.Activity;
import android.database.Cursor;
import android.util.Log;
public class GenerateFiringData extends Activity{
DBAdapter myDb1;
public GenerateFiringData(){
openDB(); //open database
.....
}
private void openDB() {
myDb1 = new DBAdapter(this);
myDb1.open();// <<<<<<<<<<problem starts here
}
private void closeDB() {
myDb1.close();
}
}
When the 'myDb1.open()' code is called it is sent to
// Open the database connection.
public DBAdapter open() {
db = myDBHelper.getWritableDatabase();<<<---------errors here
return this;
}
What am i doing wrong??? the database code for the UI part of my project goes thew this fine and i cant figure out why
Thanks Snow