package Util;
import android.app.Application;
import android.content.Context;
public class MyApplication extends Application {
private static Context context;
@Override
public void onCreate() {
// TODO Auto-generated method stub
context = getApplicationContext();
}
public static Context getContext(){
return context;
}
}
//别忘记在androidManifest.xml文件中<application>标签中指定能属性该类的全路径
//如android:name="Util.MyApplication"