Code example for HttpContext

Methods: setAttribute

0
    BasicCookieStore cookie_store = new BasicCookieStore();
 
    // Create local HTTP context 
    http_context_ = new BasicHttpContext();
    // Bind custom cookie store to the local context 
    http_context_.setAttribute(ClientContext.COOKIE_STORE, cookie_store);
  } 
 
  @Override 
  protected void onHandleIntent(Intent intent) {
    Log.d(TAG, "onHandleIntent");
    try { 
      Context context = getApplicationContext();
      if (intent.getAction().equals("com.google.android.c2dm.intent.REGISTRATION")) {
        HandleRegistration(context, intent);
      } else if (intent.getAction().equals("com.google.android.c2dm.intent.RECEIVE")) {
        HandleMessage(context, intent);
      } 
    } finally { 
      wake_lock_.release();
    }