List of usage examples for android.content Context getApplicationContext
public abstract Context getApplicationContext();
From source file:com.wbtech.ums.UmsAgent.java
/** * @param context//from w w w .j a v a2s .c o m */ public static void onError(final Context context) { Thread thread = new Thread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub MyCrashHandler handler = MyCrashHandler.getInstance(); handler.init(context.getApplicationContext()); Thread.setDefaultUncaughtExceptionHandler(handler); } }); handler.post(thread); }
From source file:com.liferay.alerts.callback.RegistrationCallback.java
public RegistrationCallback(Context context) { _context = context.getApplicationContext(); }
From source file:com.liferay.alerts.callback.AddCommentCallback.java
public AddCommentCallback(Context context) { _context = context.getApplicationContext(); }
From source file:com.pentacog.mctracker.SaveServerListTask.java
/** * */ public SaveServerListTask(Context context) { this.context = context.getApplicationContext(); }
From source file:com.liferay.alerts.callback.FetchCommentsCallback.java
public FetchCommentsCallback(Context context) { _context = context.getApplicationContext(); }
From source file:com.wuman.androidimageloader.ImageLoader.java
/** * Gets the {@link ImageLoader} from a {@link Context}. * //from w w w . ja va2 s.c om * @throws IllegalStateException * if the {@link Application} does not have an * {@link ImageLoader}. * @see #IMAGE_LOADER_SERVICE */ public static ImageLoader get(Context context) { ImageLoader loader = (ImageLoader) context.getSystemService(IMAGE_LOADER_SERVICE); if (loader == null) { context = context.getApplicationContext(); loader = (ImageLoader) context.getSystemService(IMAGE_LOADER_SERVICE); } if (loader == null) { throw new IllegalStateException("ImageLoader not available"); } return loader; }
From source file:de.vanita5.twittnuker.util.ThemeUtils.java
@NonNull private static SharedPreferencesWrapper getSharedPreferencesWrapper(Context context) { final Context appContext = context.getApplicationContext(); return SharedPreferencesWrapper.getInstance(appContext, SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE); }
From source file:com.iespuig.attendancemanager.UserFetchr.java
public UserFetchr(Context context) { this.context = context.getApplicationContext(); }
From source file:com.clarionmedia.jockey.authentication.impl.appengine.AppEngine.java
@Override protected Authenticator buildAuthenticator(Context context) { return new AppEngineAuthenticator(context.getApplicationContext(), mAccount, mHttpClient, mUrl, mActivity); }
From source file:com.liferay.alerts.callback.LikeCallback.java
public LikeCallback(Context context, long alertId) { _context = context.getApplicationContext(); _alertId = alertId; }