java - SQLiteAssetHelper extension returns null -
I am getting a NullPointerException from my database handler.
Here is my database suspender:
Public class database bundler SQLiteAssetHelper extended {personal constant end-end DATABASE_VERSION = 1; Private static last string DATABASE_NAME = "cargrid", TABLE_CARS = "car", KEY_ID = "id", KEY_POSTCODE = "postcode", KEY_ADDRESS = "address", KEY_IMAGE = "image"; Public databashendler (reference reference) {// super (references, database ANN, blank, databasebasessns); Super (context, DATABASE_NAME, context.getExternalFilesDir (empty) .getAbsolutePath (), blank, DATABASE_VERSION); MyActivity.java:
The error that is reporting which line:
// start the database databaseHandler db = new Databasandler (this); // "this" refers to the reference I'm feeling that this is creating context, but I'm not sure what the context should be. I have just changed the error from the previous line from the SQLiteOpenHelper
:
Public DataSandler (Reference Reference) {// Super (Reference, DATABASE_NAME, blank, Database_Version) ; Super (context, DATABASE_NAME, context.getExternalFilesDir (empty) .getAbsolutePath (), blank, DATABASE_VERSION); }
Your activity Databandler DB = new database (getApplicationContext ()); or
database bundle DB = new databases (your activation.);
Comments
Post a Comment