android - ContentProvider 何时真正创建?

标签 android android-contentprovider

我有一个在 list 中声明的​​ ContentProvider,它是什么时候真正创建的?当应用程序启动时但在启动第一个 Activity 之前?当第一次查询/更新/插入完成时?什么时候?

最佳答案

来自 http://developer.android.com/reference/android/content/ContentProvider.html#onCreate() :

Implement this to initialize your content provider on startup. This method is called for all registered content providers on the application main thread at application launch time. It must not perform lengthy operations, or application startup will be delayed.

关于android - ContentProvider 何时真正创建?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3483977/

相关文章:

android - 谷歌地图在 map 上不显示任何东西

android - 动嘴动画

java - 在 varnish 后面使用 reSTLet 时出错(反向代理)

android - 使用内容方案时保存文件的正确方法是什么?

java - 回答 从 1 个 Android 应用程序访问另一个应用程序的相同数据

Android:将 ZIP 解压到内存中并在 WebView 中显示其内容

Android - 与内容提供者的 Intent 匹配

android - 在 ScrollView 中使用 Canvas 绘制的问题

Android 应用程序不启动服务

Android Espresso 库导入