title: Is this the most efficient way to set listeners for my RadioGroup?
body: <p>I have a DialogView that will pop up when the user click a button, and inside this DialogView I have a RadioGroup. I want to set a listener to my RadioGroup, however I can't help but to think that my <code>setRadioGroupOnClickListener</code> will get called everytime that I press the button to create the DialogView, which seems a bit ineffecient to me...Is it possible that I can have the listeners set up so that it will only be called once in the applications entire life cycle?</p>
  <p>Here is what I have as of now and it works</p>
  <pre><code>@Override
  protected void showInputDialog() {
  
      final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
      LayoutInflater inflater = this.getLayoutInflater();
      final View dialogView = inflater.inflate(R.layout.adjective_input_layout, null);
      dialogBuilder.setView(dialogView);
      dialogBuilder.setTitle(&quot;Create new adjective flashcard&quot;);
      AlertDialog dialog = dialogBuilder.create();
      ...
  
      setRadioGroupOnClickListener(dialogView);
  
      dialog.show();
  }
  
  private void setRadioGroupOnClickListener(View v) {
      RadioGroup radioGroup = v.findViewById(R.id.adjective_translate_radio_group);
      radioGroup.setOnCheckedChangeListener((group, checkedId) -&gt; {
          switch (checkedId) {
              case R.id.adjective_manual_translation:
                  //do stuff
                  break;
              case R.id.adjective_eng_auto_translation:
                  //do some other stuff
                  break;
              case R.id.adjective_swe_auto_translation:
                  // do some other other stuff
                  break;
          }
      });
  }
  </code></pre>
  <p>OR is it better to just set an onClick listener in my layout for all three of these items?</p>