SQLiteOpenHelper Error

I read this http://developer.android.com/resources/tutorials/notepad/index.html and now try to create my own simple example. For simplicity, I do not have my adapter. When i try this

SQLiteOpenHelper dbHelper = new SQLiteOpenHelper(this,"myDB.db3", null, 1); 

in my applications onCreate method, I see Ecplise telling me

 Cannot instantiate the type SQLiteOpenHelper 

I don’t see what is basically different from the SDK tutorial (also, my call to the constructor is not wrapped in helper classes).

Thanks A.

+4
source share
1 answer

SQLiteOpenHelper is an abstract class, you must inherit it to create an instance.

 public class MyOpenHelper extends SQLiteOpenHelper { ... } MyOpenHelper dbHelper = new MyOpenHelper(...); 
+4
source

Source: https://habr.com/ru/post/1343174/


All Articles