@Override
  public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();

    if (id == android.R.id.home) {
      finish();
      return true;
    }

    if (id == R.id.action_distribute) {
      if (tv_executor.getText().toString().equals("")) {
        ToastUtil.showToast(this, "请选择施工员", Toast.LENGTH_SHORT);
        return true;
      }

      if (tv_deadline.getText().toString().equals("")) {
        ToastUtil.showToast(this, "请选择工程期限", Toast.LENGTH_SHORT);
        return true;
      }
      distribute();
      return true;
    }

    return super.onOptionsItemSelected(item);
  }
  private void saveInfo(String id) {
    if (pDialog != null) {
      pDialog.dismiss();
    }
    ContentValues values = new ContentValues();
    values.put("state", "已派工");
    DataSupport.updateAll(BusinessData.class, values, "user = ? and orderId = ?", userNo, orderId);
    ToastUtil.showToast(DistributeActivity.this, "派工成功", Toast.LENGTH_SHORT);

    Intent intent = new Intent("action.com.gzrijing.workassistant.LeaderFragment.Distribute");
    intent.putExtra("orderId", orderId);
    sendBroadcast(intent);
    finish();
  }