Ejemplo n.º 1
0
 @Override
 public void close() throws IOException {
   if (ResponseCache.getDefault() == this.delegate) {
     ResponseCache.setDefault(null);
   }
   delegate.close();
 }
  @Override
  public void onCreate() {
    super.onCreate();

    // Setting up caching
    ResponseCache.setDefault(new CEResponseCache());

    this.prefs = PreferenceManager.getDefaultSharedPreferences(this);
    this.challengeData = new ChallengeData(this);
    this.activityData = new ActivityData(this);

    // Prepare Intent for UpdaterService
    updaterServiceIntent = new Intent(this, UpdateService.class);
    updaterPendingIntent =
        PendingIntent.getService(this, -1, updaterServiceIntent, PendingIntent.FLAG_UPDATE_CURRENT);
  }
Ejemplo n.º 3
0
 public BitmapProcessor(final Context context) {
   ResponseCache.setDefault(new ImageResponseCache(context.getCacheDir()));
 }
Ejemplo n.º 4
0
 public static void installResponseCache() {
   if (!IS_CACHE_DISABLED) {
     ResponseCache.setDefault(new LocalResponseCache());
   }
 }