Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在主线程中调用SQLiteOpenHelper.getWritableDatabase()导致ANR #7

Open
HiWong opened this issue Oct 31, 2017 · 0 comments
Open

Comments

@HiWong
Copy link

HiWong commented Oct 31, 2017

其实SQLiteOpenHelper.getWritableDatabase()这个方法的注释写得很清楚了:
Database upgrade may take a long time, you should not call this method from the application main thread, including from {@link android.content.ContentProvider#onCreate ContentProvider.onCreate()}.
飞哥把这个放到子线程里,然后做个同步操作吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant