getApplicationContext()

Context android.content.ContextWrapper.getApplicationContext()
     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.

getApplicationContext()返回的context是对整个应用来讲的,只有整个应用销毁,getApplicationContext()才会销毁

猜你喜欢

转载自essencer.iteye.com/blog/2062287