我们知道Application和activity,Service都是直接间接继承Context,
- (2)为什么他们还会有一个Context对象,如下面的mBase?
- (3)那么一个应用程序的所有context之和还会只是Application和activity,Service数 目之和吗?不应该是2*activity数目+2*Service数目+Application数目
public class ContextWrapper extends Context {
Context mBase;
......
protected void attachBaseContext(Context base) {
if (mBase != null) {
throw new IllegalStateException("Base context already set");
}
mBase = base;
}
......
}