Tuesday, 17 September 2013

How to define dbhandler constructor variables in mainactivity?

How to define dbhandler constructor variables in mainactivity?

dbhandler class
public class DBHandler extends SQLiteOpenHelper{
private static final int DATABASE_VERSION = 1;
private static final String DATABASE_NAME = "feedbackDB.db";
private static final String TABLE_FEEDBACK = "feedback";
private static final String DB_PATH =
"/data/data/com.example.vbfeed/databases/";
public DBHandler(Context context, String name,CursorFactory factory, int
version) {
super(context,context.getExternalFilesDir(null).getAbsolutePath()
+ DB_PATH + DATABASE_NAME, factory, DATABASE_VERSION);
}
Main activity code under onCreate and button on Click
DBHandler dbHandler = new DBHandler(getBaseContext(),name,null, 1);
//having error in this line--just constructor defining error,
//i dono the variables to declare

No comments:

Post a Comment