@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (Tools.isPortrait(this)) {
      if (keyCode == KeyEvent.KEYCODE_MENU) {

        if (!sp.get("menu_open", false)) {

          if (pop != null && pop.isShowing()) {
            hideMenu();

            madapter.notifyDataSetChanged();
          } else {
            showMenu();

            madapter.notifyDataSetChanged();
            // for (DCMyViewGroupHuiZhiBaoGao p : this.items) {
            // p.setCheck("2");
            // }

          }
        }

      } else if (keyCode == KeyEvent.KEYCODE_BACK) {

        if (pop != null && pop.isShowing()) {
          hideMenu();
          selitem.clear();
          madapter.notifyDataSetChanged();
          return true;
        }
      }
    }

    return super.onKeyDown(keyCode, event);
  }
  /**
   * @param reals 全部短信、未送达、已送达的集合
   * @param str 没有相关短信时显示的提示语
   * @return
   */
  public View getFirstView(ArrayList<BodyBeanHuiZhi> reals, String nodatatip, int clicktype) {

    // huizhi_gongnen_div.setVisibility(View.GONE);
    huizhi_listview_div.setVisibility(View.VISIBLE);
    if (reals.size() != 0) {
      madapter.setData(reals);
      madapter.notifyDataSetChanged();
      huizhi_listview_div.setVisibility(View.VISIBLE);
      huizhi_empty_text.setVisibility(View.GONE);
    } else {
      if (TextUtils.isEmpty(spNumber) || TextUtils.isEmpty(sContent)) {
        getData();
      }
      huizhi_listview_div.setVisibility(View.GONE);
      huizhi_empty_text.setVisibility(View.VISIBLE);
      // huizhi_empty_text.setText(nodatatip);
    }

    filter.addAction(Sms.SENT_SMS_ACTION);
    registerReceiver(sendMsgReceiver, filter);
    // this.items.clear();
    // View view2 = null;
    // array_mainlist_main.clear();
    // // hdao = HuiZhiBaoGaoDao.getInstance(this);
    // view2 = infater.inflate(R.layout.dc_def_main, null);
    // RelativeLayout lvTop = (RelativeLayout) view2
    // .findViewById(R.id.ll_main_top);
    // android.widget.RelativeLayout.LayoutParams anzhiLP = new
    // RelativeLayout.LayoutParams(
    // LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
    // anzhiLP.addRule(RelativeLayout.CENTER_IN_PARENT);
    // if (reals != null && reals.size() > 0) {
    // array_mainlist_main.addAll(reals);
    // LinearLayout lv = (LinearLayout) view2.findViewById(R.id.ll_main);
    // for (int i = 0; i < array_mainlist_main.size(); i++) {
    //
    // ArrayList<BodyBeanHuiZhi> arrayList = array_mainlist_main
    // .get(i);
    //
    // if (arrayList.size() > 0) {
    // lv.addView(getListChildView2(arrayList, clicktype));
    // }
    //
    // }
    //
    // } else {
    // sp.update("menu_open", true);// 关闭menu
    // TextView mTextView = new TextView(SmsHuiZhiMainActivity.this);//
    // 构造textView对象
    // mTextView.setTextSize(22.0f);
    // mTextView.setTextColor(Color.parseColor("#8a99c4"));
    // mTextView.setText(str);
    // mTextView.setGravity(Gravity.CENTER);
    // lvTop.addView(mTextView, anzhiLP);
    // }
    return null;
  }
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.gd_empty_lh_hz_btn:
        if (!TextUtils.isEmpty(spNumber) && !TextUtils.isEmpty(sContent)) {
          intent = new Intent(this, ConfirmDialogActivity.class);
          intent.putExtra(Constant.DIALOG_KEY, Constant.NOW_OPEN);
          intent.putExtra(Constant.DIALOG_PROVICE_TITLE, "短信回执");
          intent.putExtra(Constant.QG_BUSINESS_CODE, sContent);
          intent.putExtra(Constant.QG_BUSINESS_POST, spNumber);
          startActivity(intent);
        } else {
          Toast.makeText(this, "系统忙,请稍候再试!", 0).show();
        }
        break;

      case R.id.gd_iv_titlebar_left:
        finish();
        break;

      case R.id.gd_iv_titlebar_right:
        isActivation();
        break;

      case R.id.ll_pingdaodingzhi:
        if (this.isActivated()) {
          intent = new Intent();
          // intent.setClass(SmsHuiZhiMainActivity.this,PingDaoDingZhiActivity.class);
          intent.setClass(SmsHuiZhiMainActivity.this, ChannelCustomActivity.class);
          startActivity(intent);
        } else {
          Intent i = new Intent(SmsHuiZhiMainActivity.this, ConfirmDialogActivity.class);
          i.putExtra(Constant.DIALOG_KEY, Constant.DO_ACTIVE);
          startActivityForResult(i, 100);
        }
        break;

      case R.id.ll_jieshouchangjing:
        if (this.isActivated()) {
          intent = new Intent();
          // intent2.setClass(SmsHuiZhiMainActivity.this,JieShouChangJingActivity.class);
          intent.setClass(SmsHuiZhiMainActivity.this, ConfirmDialogActivity.class);
          intent.putExtra(Constant.DIALOG_KEY, Constant.STAGE_MODE);
          startActivityForResult(intent, 100);
        } else {
          intent = new Intent(SmsHuiZhiMainActivity.this, ConfirmDialogActivity.class);
          intent.putExtra(Constant.DIALOG_KEY, Constant.DO_ACTIVE);
          startActivityForResult(intent, 100);
        }
        break;

      case R.id.ll_all_choose:

        // for (DCMyViewGroupHuiZhiBaoGao p : this.items) {
        // p.setCheck("all");
        // }
        //
        if (click_type == 0) {

          for (BodyBeanHuiZhi item1 : all_reals) {
            selitem.put(item1.cdate, item1);
          }
        }
        madapter.notifyDataSetChanged();
        break;

      case R.id.ll_delete:
        // todo yang
        // dls = new ArrayList<DeleteVO>();
        // for (DCMyViewGroupHuiZhiBaoGao p : this.items) {
        // if (p.isChecked()) {
        // DeleteVO d = new DeleteVO();
        // d.telnumber = p.body.tosomebody;
        // d.month = p.body.amonth;
        // dls.add(d);
        // }
        // }
        if (selitem.keySet().isEmpty()) {
          return;
        }
        intent = new Intent(this, ConfirmDialogActivity.class);
        intent.putExtra(Constant.DIALOG_KEY, Constant.DELETE_RECORD);
        intent.putExtra(Constant.DIALOG_CONTENT, "删除联系人短信回执记录?");
        startActivityForResult(intent, 100);
        // ApplicationManager am = (ApplicationManager)
        // getApplication();
        // am.dls = dls;
        // Intent intent6 = new Intent();
        // intent6.putExtra(Constant.PHONE_NUMBER, "delete_select");
        // intent6.setClass(this, DeleteHuiZhiALLDialogActivity.class);
        // startActivity(intent6);

        break;

      case R.id.ll_cancle:

        // for (DCMyViewGroupHuiZhiBaoGao p : this.items) {
        // p.setCheck("cancel");
        // }
        selitem.clear();
        madapter.notifyDataSetChanged();

        break;
    }
  }