public class BaseApplication extends Application {
private static Context sContext = null;
private static Handler sHandler = null;
@Override
public void onCreate() {
super.onCreate();
sContext = getBaseContext();
sHandler = new Handler();
}
public static Context getContext() {
return sContext;
}
public static Handler getHandler() {
return sHandler;
}
}
在manifest
android:name=".base.BaseApplication"