title: Multiple Buttons' OnClickListener() android
body: <p>I'm currently making a simple calculator app on Android. Im trying to set up the code so that when a number button is pressed it updates the calculator screen with that number. Currently I'm doing it like this. </p>
  
  <pre><code>    Button one = (Button) findViewById(R.id.oneButton);
      one.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              TextView output = (TextView) findViewById(R.id.output);
              output.append("1");
          }
      });
  </code></pre>
  
  <p>It works but I'm writing this same code for every single button on the calculator. As you can imagine it is very redundant. Is there anyway I can write this code in a more efficient way? One that involves not writing this method for every single button? </p>