Skip to content

Instantly share code, notes, and snippets.

@hi-manshu
Created November 25, 2017 15:33
Show Gist options
  • Save hi-manshu/269fe1a99122349b4ae34cfb97737d5c to your computer and use it in GitHub Desktop.
Save hi-manshu/269fe1a99122349b4ae34cfb97737d5c to your computer and use it in GitHub Desktop.
public class ApplicationInit extends Application {
private static Context context;
private static ApplicationInit mInstance;
@Override
public void onCreate() {
super.onCreate();
ApplicationInit.context = getApplicationContext();
SharedPreference.init(getApplicationContext());
mInstance = this;
}
public static Context getAppContext() {
return ApplicationInit.context;
}
public static ApplicationInit getInstance() {
return mInstance;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment