You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ProviGenProvider uses onCreate() method to initialise SQLiteOpenHelper which causes ANR error.
@Override
public boolean onCreate() {
openHelper = openHelper(getContext());
...
}
Due to Android ContentProvider documentation onCreate() method runs on main thread and "It must not perform lengthy operations, or application startup will be delayed." .
From documentation: "You should defer nontrivial initialization (such as opening, upgrading, and scanning databases) until the content provider is used (via query(Uri, String[], Bundle, CancellationSignal), insert(Uri, ContentValues), etc)."
ProviGenProvider uses onCreate() method to initialise SQLiteOpenHelper which causes ANR error.
Due to Android ContentProvider documentation onCreate() method runs on main thread and "It must not perform lengthy operations, or application startup will be delayed." .
From documentation:
"You should defer nontrivial initialization (such as opening, upgrading, and scanning databases) until the content provider is used (via query(Uri, String[], Bundle, CancellationSignal), insert(Uri, ContentValues), etc)."
https://developer.android.com/reference/android/content/ContentProvider#onCreate()
What about to initialise SQLiteOpenHelper lazily from other methods such a query, insert and so on?
The text was updated successfully, but these errors were encountered: