2011年5月31日火曜日

can we assure that Application#onCreate always runs before the Provier#onCreate and Activity#onCreate

I wouldn't count on one or the other. For your problem, just have a global
singleton for accessing the data, and retrieve that everywhere you need it.
The first one who gets it will initialize it.

On Mon, Nov 24, 2008 at 9:16 PM, magicpig <[EMAIL PROTECTED]> wrote:

>
> Hi,
> I have a AndroidManifest.xml:
> <application .....>
>
> <activity....>
> </activity>
>
> <provider...>
> <provider...>
> </application>
>
> I guess the Application#onCreate always runs first. But during
> some experiments, Provider#onCreate may run before
> Application#onCreate.
>
> I want to find a place that can read the meta-data from
> AndroidManifest.xml that will be used for the whole application and I
> put it in Application#onCreate. During my experiment... I am afraid I
> have made a mistake. Any one can tell me where is the right place,
> the first will read the meta-data before all the onCreates run.
>
> Thanks a lot.

0 件のコメント:

コメントを投稿