示例#1
0
  @Override
  protected void onHandleIntent(Intent intent) {

    Log.v(TAG, "AMQP on Handle Event");

    String msg = intent.getStringExtra(Constants.AMQP_PUBLISH_MESSAGE);

    if (msg == null) return;
    try {
      Log.d(TAG, "[q] " + msg);
      publishQueue.putLast(msg);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
示例#2
0
  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    Log.v(TAG, "AMQP onStartCommand");

    String msg = intent.getStringExtra(Constants.AMQP_PUBLISH_MESSAGE);

    if (msg == null) return 0;
    try {
      Log.d(TAG, "[q] " + msg);
      publishQueue.putLast(msg);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    return 1;
  }