In my android app: How can I get access to Context in the onCreate method of the SQLiteOpenHelper?

有帮助吗?

解决方案

You extend SQLiteOpenHelper and in your own constructor, save it to a field. Then, later, in onCreate() you have access to the context.

其他提示

You can extend that class and pass the context to the constructor, which stores it inside a variable. You then can access it from within the onCreate method.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top