title: RadioButtons and Buttons not doing anything in custom Dialog
body: <p>So I created custom <code>xml</code> dialog and I want to program it like this: It has two <code>RadioButton</code>s and if one is clicked some UI elements like <code>TextView</code>s and <code>EditTex</code>ts appear, and they dissapear if the other <code>RadioButton</code> is checked.</p>
  
  <p>The problem is, <code>Button</code> and <code>RadioButton</code>s are not doing anything. I've set visibility for UI elements to appear and dissapear as <code>RadioButton</code>s are checked but it's not working. Same thing with <code>Button</code>, it should pass the result in activites <code>EditText</code> but when pressed it does nothing.</p>
  
  <p>I don't get any errors so please don't ask me to post logcats because app does not crash.</p>
  
  <p>Here's the code of that dialog:</p>
  
  <pre><code>statistikeInputDialogKalkulatoriFFMI = (ImageView) findViewById(R.id.statistikeInputDialogKalkulatoriFFMI);
  
  
      statistikeInputDialogKalkulatoriFFMI.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              final Dialog dialog = new Dialog(StatistikeInputMain.this);
              dialog.setContentView(R.layout.dialog_statistike_uredi_ffmi);
              dialog.setTitle(getResources().getString(R.string.dialog_uredi1RM));
              dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
              dialog.show();
              RadioGroup radioGrupaDialogFFMI = (RadioGroup) findViewById(R.id.radioGrupaDialogFFMI);
              final RadioButton radioButtonDialogFFMIMetric = (RadioButton) findViewById(R.id.radioButtonDialogFFMIMetric);
              final RadioButton radioButtonDialogFFMIImperial = (RadioButton) findViewById(R.id.radioButtonDialogFFMIImperial);
              textTezinaDialogFFMI = (TextView)dialog. findViewById(R.id.textTezinaDialogFFMI);
              textBodyFatDialogFFMI = (TextView)dialog. findViewById(R.id.textBodyFatDialogFFMI);
              textVisinaDialogMetricFFMI = (TextView)dialog. findViewById(R.id.textVisinaDialogMetricFFMI);
              textVisinaDialogImperialFFMI = (TextView)dialog. findViewById(R.id.textVisinaDialogImperialFFMI);
              editTezinaDialogFFMI = (EditText)dialog. findViewById(R.id.editTezinaDialogFFMI);
              editBodyFatDialogFFMI = (EditText)dialog. findViewById(R.id.editBodyFatDialogFFMI);
              editVisinaDialogMetricFFMI = (EditText)dialog. findViewById(R.id.editVisinaDialogMetricFFMI);
              editVisinaDialogImperialFFMIFEET = (EditText)dialog. findViewById(R.id.editVisinaDialogImperialFFMIFEET);
              editVisinaDialogImperialFFMIINCH = (EditText)dialog. findViewById(R.id.editVisinaDialogImperialFFMIINCH);
              buttonDialogIzracunajFFMI = (Button)dialog. findViewById(R.id.buttonDialogIzracunajFFMI);
              editTextStatistikeFFMI = (EditText)dialog. findViewById(R.id.editTextStatistikeFFMI);
  
              textVisinaDialogMetricFFMI.setVisibility(View.GONE);
              textVisinaDialogImperialFFMI.setVisibility(View.GONE);
              editVisinaDialogMetricFFMI.setVisibility(View.GONE);
              editVisinaDialogImperialFFMIFEET.setVisibility(View.GONE);
              editVisinaDialogImperialFFMIINCH.setVisibility(View.GONE);
  
              switch (v.getId()) {
                  case R.id.radioButtonDialogFFMIMetric:
              boolean checked = ((RadioButton) v).isChecked();
  
                      if (checked)
  
                          textTezinaDialogFFMI.setVisibility(View.VISIBLE);
                      textBodyFatDialogFFMI.setVisibility(View.VISIBLE);
                      textVisinaDialogMetricFFMI.setVisibility(View.VISIBLE);
                      editTezinaDialogFFMI.setVisibility(View.VISIBLE);
                      editBodyFatDialogFFMI.setVisibility(View.VISIBLE);
                      editVisinaDialogMetricFFMI.setVisibility(View.VISIBLE);
                      buttonDialogIzracunajFFMI.setVisibility(View.VISIBLE);
  
                      buttonDialogIzracunajFFMI.setOnClickListener(new View.OnClickListener() {
                          @Override
                          public void onClick(View v) {
                              double tezina = Double.parseDouble(editTezinaDialogFFMI.getText().toString());
                              double bodyfat = Double.parseDouble(editBodyFatDialogFFMI.getText().toString());
                              double visina = Double.parseDouble(editVisinaDialogMetricFFMI.getText().toString());
                              double rezultatLean = 0;
                              double rezultatFFMI = 0;
  
                              rezultatLean = tezina * (1.0 - (bodyfat / 100.0));
                              rezultatLean = Math.round(rezultatLean * 100.0) / 100.0;
  
  
                              rezultatFFMI = (rezultatLean / 2.2) / (((visina / 2.54) * 0.0254) * ((visina / 2.54) * 0.0254)) * 2.20462;
                              rezultatFFMI = Math.round(rezultatFFMI * 100.0) / 100.0;
                              editTextStatistikeFFMI.setText(Double.toString(rezultatFFMI));
  
                              dialog.dismiss();
  
                          }
                      });
  
                  case R.id.radioButtonDialogFFMIImperial:
                      boolean checked1 = ((RadioButton) v).isChecked();
  
                      if (checked1)
  
                          textTezinaDialogFFMI.setVisibility(View.VISIBLE);
                      textBodyFatDialogFFMI.setVisibility(View.VISIBLE);
                      textVisinaDialogImperialFFMI.setVisibility(View.VISIBLE);
                      editTezinaDialogFFMI.setVisibility(View.VISIBLE);
                      editBodyFatDialogFFMI.setVisibility(View.VISIBLE);
                      editVisinaDialogImperialFFMIFEET.setVisibility(View.VISIBLE);
                      editVisinaDialogImperialFFMIINCH.setVisibility(View.VISIBLE);
                      buttonDialogIzracunajFFMI.setVisibility(View.VISIBLE);
                      buttonDialogIzracunajFFMI.setOnClickListener(new View.OnClickListener() {
                          @Override
                          public void onClick(View v) {
                              double tezina = Double.parseDouble(editTezinaDialogFFMI.getText().toString());
                              double bodyfat = Double.parseDouble(editBodyFatDialogFFMI.getText().toString());
                              double visinaFEET = Double.parseDouble(editVisinaDialogImperialFFMIFEET.getText().toString());
                              double visinaINCH = Double.parseDouble(editVisinaDialogImperialFFMIINCH.getText().toString());
                              double rezultatLean = 0;
                              double rezultatFFMI = 0;
  
  
                              rezultatLean = tezina * (1.0 - (bodyfat / 100.0));
                              rezultatLean = Math.round(rezultatLean * 100.0) / 100.0;
  
  
                              rezultatFFMI = (rezultatLean / 2.2) / (((visinaFEET * 12.0 + visinaINCH) * 0.0254) * ((visinaFEET * 12.0 + visinaINCH) * 0.0254));
                              rezultatFFMI = Math.round(rezultatFFMI * 100.0) / 100.0;
                              editTextStatistikeFFMI.setText(Double.toString(rezultatFFMI));
  
                              dialog.dismiss();
  
  
                          }
  
                      });
              }
  </code></pre>