Code example for SynchronousQueue

Methods: put

0
    public void onClick(DialogInterface dialog, int button) {
      try { 
        if (button >= 0) {
          String account = accountNames[button];
          Log.i(LOG_TAG, "Chose: " + account);
          queue.put(account);
        } else { 
          queue.put(NO_ACCOUNT);
        } 
      } catch (InterruptedException e) {
        // This should never happen 
      } 
      dialog.dismiss();
    } 
 
    @Override 
    public void onCancel(DialogInterface dialog) {
      Log.i(LOG_TAG, "Chose: canceled");
      onClick(dialog, -1);
    }