开发者

SQLiteOpenHelper error

I read this http://developer.android.com/resources/tutorials/notepad/index.html and now try to create my own simple example. For simplification reasons I don't have my own Adapter Class. 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 am not seeing what is basically different from the SDK tutorial (apart from that my call to the constructor is开发者_如何学C not wrapped in helper classes).

Thanks, A.


SQLiteOpenHelper is an abstract class, you should inherit from it in order to instantiate one.

public class MyOpenHelper extends SQLiteOpenHelper {

...

}

MyOpenHelper dbHelper = new MyOpenHelper(...);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜