I am very new to android programming. I want to use SQLiteOpenHelper class to do some database operations. here is my SqliteController class that extends SQLiteOpenHelper:
public class SqliteController extends SQLiteOpenHelper {
Context context;
public SqliteController(Context context) {
super(context, "sectionsDB", null, 1);
this.context = context;
}
@Override
public void onCreate(SQLiteDatabase db) {
String query;
query = "CREATE TABLE Sections ( chapterName TEXT, sectionName TEXT, body TEXT)";
db.execSQL(query);
Log.i("tablecreation", "table created");
(I have just mentioned the part that I have problem with) in my main activity I have created instance of above class in onCreate method of activity like this:
SqliteController controller = new SqliteController(this);
when I run application for the first time the Log part does not execute so I do not see any Log statement in logcat. what is the problem with it?
Aucun commentaire:
Enregistrer un commentaire