<small id='wqkOk'></small><noframes id='wqkOk'>

    <tfoot id='wqkOk'></tfoot><legend id='wqkOk'><style id='wqkOk'><dir id='wqkOk'><q id='wqkOk'></q></dir></style></legend>

        • <bdo id='wqkOk'></bdo><ul id='wqkOk'></ul>
      1. <i id='wqkOk'><tr id='wqkOk'><dt id='wqkOk'><q id='wqkOk'><span id='wqkOk'><b id='wqkOk'><form id='wqkOk'><ins id='wqkOk'></ins><ul id='wqkOk'></ul><sub id='wqkOk'></sub></form><legend id='wqkOk'></legend><bdo id='wqkOk'><pre id='wqkOk'><center id='wqkOk'></center></pre></bdo></b><th id='wqkOk'></th></span></q></dt></tr></i><div id='wqkOk'><tfoot id='wqkOk'></tfoot><dl id='wqkOk'><fieldset id='wqkOk'></fieldset></dl></div>

        取消选中 RadioButton 的 - 替代方法

        时间:2023-09-09

        1. <small id='zDLvd'></small><noframes id='zDLvd'>

          <tfoot id='zDLvd'></tfoot>
            <tbody id='zDLvd'></tbody>
          <i id='zDLvd'><tr id='zDLvd'><dt id='zDLvd'><q id='zDLvd'><span id='zDLvd'><b id='zDLvd'><form id='zDLvd'><ins id='zDLvd'></ins><ul id='zDLvd'></ul><sub id='zDLvd'></sub></form><legend id='zDLvd'></legend><bdo id='zDLvd'><pre id='zDLvd'><center id='zDLvd'></center></pre></bdo></b><th id='zDLvd'></th></span></q></dt></tr></i><div id='zDLvd'><tfoot id='zDLvd'></tfoot><dl id='zDLvd'><fieldset id='zDLvd'></fieldset></dl></div>
          <legend id='zDLvd'><style id='zDLvd'><dir id='zDLvd'><q id='zDLvd'></q></dir></style></legend>

              <bdo id='zDLvd'></bdo><ul id='zDLvd'></ul>

                1. 本文介绍了取消选中 RadioButton 的 - 替代方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有没有办法通过单击选中的 RadioButton 来取消选中 RadioButton?

                  Is there any possible way to uncheck a RadioButton by cliking on the checked RadioButton?

                  推荐答案

                  RadioGroup radioGroup;
                  RadioButton radioButton1;
                  RadioButton radioButton2;
                  RadioButton radioButton3;
                  
                  boolean hack = false;
                  
                  @Override
                  protected void onCreate(Bundle savedInstanceState)
                  {
                      super.onCreate(savedInstanceState);
                      setContentView(R.layout.main);
                  
                      radioGroup = (RadioGroup) findViewById(R.id.rg);
                      radioButton1 = (RadioButton) findViewById(R.id.r1);
                      radioButton2 = (RadioButton) findViewById(R.id.r2);
                      radioButton3 = (RadioButton) findViewById(R.id.r3);
                  
                      OnClickListener radioClickListener = new OnClickListener()
                      {
                  
                          public void onClick(View v)
                          {
                              if (v.getId() == radioGroup.getCheckedRadioButtonId() && hack)
                              {
                                  radioGroup.clearCheck();
                              }
                              else
                              {
                                  hack = true;
                              }
                          }
                      };
                  
                      OnCheckedChangeListener radioCheckChangeListener = new OnCheckedChangeListener()
                      {
                  
                          @Override
                          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
                          {
                              hack = false;
                          }
                      };
                  
                      radioButton1.setOnCheckedChangeListener(radioCheckChangeListener);
                      radioButton2.setOnCheckedChangeListener(radioCheckChangeListener);
                      radioButton3.setOnCheckedChangeListener(radioCheckChangeListener);
                  
                      radioButton1.setOnClickListener(radioClickListener);
                      radioButton2.setOnClickListener(radioClickListener);
                      radioButton3.setOnClickListener(radioClickListener);
                  
                  }
                  

                  好的,现在我已经更新了.这应该工作菲利普兹

                  Ok now i have updated it. This should work Philipz

                  这篇关于取消选中 RadioButton 的 - 替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:应用小部件 setImageViewUri 不更新图像 下一篇:Android小部件在一段时间后停止工作?

                  相关文章

                  1. <tfoot id='8XBDu'></tfoot>
                  2. <i id='8XBDu'><tr id='8XBDu'><dt id='8XBDu'><q id='8XBDu'><span id='8XBDu'><b id='8XBDu'><form id='8XBDu'><ins id='8XBDu'></ins><ul id='8XBDu'></ul><sub id='8XBDu'></sub></form><legend id='8XBDu'></legend><bdo id='8XBDu'><pre id='8XBDu'><center id='8XBDu'></center></pre></bdo></b><th id='8XBDu'></th></span></q></dt></tr></i><div id='8XBDu'><tfoot id='8XBDu'></tfoot><dl id='8XBDu'><fieldset id='8XBDu'></fieldset></dl></div>
                      <legend id='8XBDu'><style id='8XBDu'><dir id='8XBDu'><q id='8XBDu'></q></dir></style></legend>
                        <bdo id='8XBDu'></bdo><ul id='8XBDu'></ul>

                      <small id='8XBDu'></small><noframes id='8XBDu'>