Android重要概念2—Application类
来源:互联网 发布:墙面网络面板 编辑:程序博客网 时间:2024/05/21 19:43
Application类
Base class for those who need to maintain global application state. You can provide your own implementation by specifying its name in your AndroidManifest.xml's <application> tag, which will cause that class to be instantiated for you when the process for your application/package is created.
There is normally no need to subclass Application. In most situation, static singletons can provide the same functionality in a more modular way. If your singleton needs a global context (for example to register broadcast receivers), the function to retrieve it can be given a Context
which internally usesContext.getApplicationContext()
when first constructing the singleton.
Context.getApplicationContext()
public abstract ContextgetApplicationContext()
Return the context of the single, global Application object of the current process. This generally should only be used if you need a Context whose lifecycle is separate from the current context, that is tied to the lifetime of the process rather than the current component.
- Android重要概念2—Application类
- Android重要概念3—Activity类
- Android重要概念1-Handler类
- Android生命周期重要概念详解
- Android学习笔记2-开发过程中一些重要概念
- Android重要概念3—App进程的生命周期
- 重要概念——继承
- android应用开发的几个重要概念
- Spark Cluster与Application中的重要概念以及如何提交应用spark-submit
- Loadrunner重要概念——事务
- Loadrunner重要概念——参数化
- Loadrunner重要概念——关联
- Loadrunner重要概念——检查点
- Loadrunner重要概念——集合点
- Git学习——重要概念
- LINQ简记(2):重要概念
- linux编程学习2-重要的概念
- Android架构宏观理解和Android四个重要组件概念
- 【胡侃Java】Java抽象类
- debian6 电信使用的源
- JQuery学习《一》
- 如何在spring框架中解决多数据源的问题
- 能上Q打不开网页.
- Android重要概念2—Application类
- 感兴趣的领域
- 关于考勤
- poj 1088 滑雪
- 给全局变量赋值出异常
- mysql插入反斜杠"\"丢失的解决方法
- Spring MVC过滤器-超类
- android2.1-src-tree
- 道听途说Struts2之12:include模块包含