在应用程序实例之前的任何活动始终创建? [英] Is the Application instance always created before any Activities?

查看:140
本文介绍了在应用程序实例之前的任何活动始终创建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android中,你可以通过扩展,并在清单中声明名称提供自己的应用程序类。

我的问题是,这个实现总是最初的活动之前创建,也可以活动启动应用程序实例已收到将要创建的时间?

解决方案
  

这将执行初始活动之前始终创建

是的。这是实例化的过程中的第一个对象之一。

In Android, you can provide your own implementation of the Application class by extending it and declaring the name in the Manifest.

My question is, will this implementation always be created before the initial Activity, or can Activities be launched before the Application instance has had time to be created?

解决方案

will this implementation always be created before the initial Activity

Yes. It is one of the first objects instantiated in your process.

这篇关于在应用程序实例之前的任何活动始终创建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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