Simple program, In my activity I have an edit text where I add text and press add button and it will be added to the database. Here I have database helper class which has database version and name in it. I am having a simple error as mentioned in title and it goes away with static declaration for the variables. What does this error mean can anyone tell me? Here is my code.
public class DBHelper extends SQLiteOpenHelper {
private final String DATABASE_NAME = "product.db";
private final int DATABASE_VERSION = 1;
private static final String TABLE_PRODUCTS = "product";
private static final String COLUMN_ID = "_id";
private static final String COLUMN_PRODUCTNAME = "_productname";
public DBHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
super(context, DATABASE_NAME, factory, DATABASE_VERSION); //in both version and name I am getting error as mentioned in title line.
}//it goes after I declare both vars static. What is the reason?
@Override
public void onCreate(SQLiteDatabase db) {
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
just want to know what is the error about. explanation..thank you in advance...
Aucun commentaire:
Enregistrer un commentaire