a various of context

拟墨画扇 提交于 2020-04-03 08:41:08

ContextWrapper.getApplicationContext():Return the context of the single, global Application object of the current process
生命周期是整个应用,应用摧毁它才摧毁
View.getContext():Returns the context the view is running in
this(activity or service):返回当前activity or service的上下文,属于activity or service,activity or service 摧毁他就摧毁
ContextWrapper.getBaseContext():Return the base context as set by the constructor or setBaseContext
返回由构造函数指定或setBaseContext()设置的上下文
Activity.getParent():Return the parent activity if this view is an embedded child.
Activity.getApplication():Return the application that owns this activity

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!