这里android:name是指Manifest中Application的属性,而不是Application里Activity属性里的android:name。

官方连接:https://developer.android.google.cn/guide/topics/manifest/activity-element.html

官方原文:

The fully qualified name of an Application subclass implemented for the application. When the application process is started, this class is instantiated before any of the application's components.
The subclass is optional; most applications won't need one. In the absence of a subclass, Android uses an instance of the base Application class.

根据我自己理解翻译(如有错误望指出,谢谢):

android:name="指定一个子类应用充分正确的名字(完整的包名应用名) "

作用 :

  • 当应用程序进程启动时,这个被指定的子类在任何应用的组件之前被实例化。
  • 一般情况下并不需要指定子类(也就是说android:name这个属性是可选的)。
  • 在你没有指定子类的情况下,系统(Android)会自动实例化应用程序基础类。

更多相关文章

  1. Android(安卓)TextView背景色、圆角、内部填充设置
  2. Android(安卓)8.0 Caused by: java.lang.IllegalStateException:
  3. android 常用资料
  4. Android(安卓)AnimationSet详解
  5. Android(安卓)Manifest之元素中文注释
  6. Android中visibility属性VISIBLE、INVISIBLE、GONE的区别
  7. activity页面切换效果
  8. Android(安卓)Studio常见布局报错及解决方案
  9. 当scroll时改变item的背景

随机推荐

  1. Android(安卓)开源框架选择
  2. Android(安卓)Jetpack之Navigation源码分
  3. react-native修改android包名
  4. 使用FileProvider共享文件
  5. 报错 Error:Could not install Gradle di
  6. Android(安卓)适配屏幕问题(一) 自动生成di
  7. Android调用摄像头拍照和从相册中选择(上
  8. Android事件分发机制------------>验证+
  9. Android(安卓)Monkey测试及源码分析
  10. Android(安卓)Studio 导出APK