public class MyApplication extends Application {
private static Context context = null;
private static MyApplication myApplication = null;
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
Log.v("MyApplication", "onCreate");
context = this.getApplicationContext();
myApplication = this;
}
public static Context getContext() {
return context;
}
private static Context context = null;
private static MyApplication myApplication = null;
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
Log.v("MyApplication", "onCreate");
context = this.getApplicationContext();
myApplication = this;
}
public static Context getContext() {
return context;
}
}
//Androidmanifest.xml
<application
android:allowBackup="true"
android:name="com.example.testcontent.MyApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >