为什么ContentProvider.onCreate()在Application.onCreate()之前被调用? [英] Why does ContentProvider.onCreate() get called before Application.onCreate()?

查看:462
本文介绍了为什么ContentProvider.onCreate()在Application.onCreate()之前被调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AndroidManifest.xml中注册了ContentProvider,甚至在Application.onCreate()之前也调用了ContentProvider.onCreate().我认为我不了解这种行为,在应用程序中的任何组件之前调用Application.onCreate()更为自然.有人可以告诉我调用Application.onCreate()和其他组件的onCreate()的时间吗?

I registered a ContentProvider in AndroidManifest.xml, and the ContentProvider.onCreate() was called even before the Application.onCreate(). I don't understand this behavior, in my opinion, It's more natural that Application.onCreate() be called before any of the components in the application. Could someone tell me the timing of Application.onCreate() and other components' onCreate() gets called?

推荐答案

根据

According a Google's issue it's how this should work (although documentation is wrong).

还有另一个问题,其工作环境可以为您提供帮助

There's another question that have a workarround that can help you.

这篇关于为什么ContentProvider.onCreate()在Application.onCreate()之前被调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆