문제

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