Getwritabledatabase() Throwing Null Pointer Exception In My Apps
I am having trouble with my call to getWritableDatabase(). It is returning a NullPointerException. The thing that is strangest is that this error only began occurring after I comme
Solution 1:
The Context
passed to your db helper is null. Your fragment is not attached to an activity when instantiating it and getActivity()
returns null. Move the db helper initialization to a later phase of the fragment lifecycle such as onCreate()
.
Post a Comment for "Getwritabledatabase() Throwing Null Pointer Exception In My Apps"