title: implements various onclick events
body: <p>hello I have a big problem with a button on click and two edit texts, I create my own keypad with twelve buttons and two edit text, the first edit text allow input number only and the second allow input number and do calculation. my real problem is that I can not input in the second edit text only in the first. here is a draw</p>
  
  <pre><code>        *********** *********
          *    1    * *   2   *   // These are EditTexts 
          *********** *********
  
          **************************
          *   7   *   8    *   9   *   
          **************************
          *   4   *   5    *   6   *  // These are Buttons
          **************************
          *   1   *   2    *   3   *
          **************************
          *   0   *   c    *   +   *
          **************************
  </code></pre>
  
  <p>(+) this button do the calculations and change the focus on the edit texts</p>
  
  <p>also here is the code: thanks in advance I will appreciate any kind of help</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main_cornuta);
  
           setupListView(); //set the list view
           inJugada = (EditText) findViewById(R.id.edit_x);
           inJugada.requestFocus();
  
           inValor = (EditText) findViewById(R.id.edit_y);
  
           inTotal = (EditText) findViewById(R.id.edit_z);
           inTotal.setText("");
           tv = (TextView) this.findViewById(R.id.textView2);  
           btnMensage = (ImageButton)findViewById(R.id.imageButton1);
           btnCombina = (Button)findViewById(R.id.button6);
  
           //Implementation for button 0123456789+delclr
           final Button bt0 = (Button) findViewById(R.id.btnNum0Id);
      bt0.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "0";
              }else if(inJugada.requestFocus() == false){
                  numberDisplayed += "0";
              }
  
              updateTextField();
  
          }
      });
  
      final Button bt1 = (Button) findViewById(R.id.btnNum1Id);   
      bt1.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "1";
              }else if(inValor.requestFocus() == true){
                  numberDisplayed += "1";
              }
              updateTextField();
  
          }
      });
  
      final Button bt2 = (Button) findViewById(R.id.btnNum2Id);
      bt2.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "2";
              }else if(inValor.requestFocus() == true){
                  numberDisplayed += "2";
              }
              updateTextField();
          }
      });
  
      final Button bt3 = (Button) findViewById(R.id.btnNum3Id);
      bt3.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "3";
              }else if(inValor.requestFocus() == true){
                  numberDisplayed += "3";
              }
              updateTextField();
          }
      });
  
      final Button bt4 = (Button) findViewById(R.id.btnNum4Id);
      bt4.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "4";
              }else if(inValor.requestFocus() == true){
                  numberDisplayed += "4";
              }
              updateTextField();
          }
      });
  
      final Button bt5 = (Button) findViewById(R.id.btnNum5Id);
      bt5.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "5";
              }else if(inValor.requestFocus() == true){
                  numberDisplayed += "5";
              }
              updateTextField();
          }
      });
  
      final Button bt6 = (Button) findViewById(R.id.btnNum6Id);
      bt6.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "6";
              }else if(inValor.requestFocus() == true){
                  numberDisplayed += "6";
              }
              updateTextField();
          }
      });
  
      final Button bt7 = (Button) findViewById(R.id.btnNum7Id);
      bt7.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "7";
              }else if(inValor.requestFocus() == true){
                  numberDisplayed += "7";
              }
              updateTextField();
          }
      });
  
      final Button bt8 = (Button) findViewById(R.id.btnNum8Id);
      bt8.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "8";
              }else if(inValor.requestFocus() == true){
                  numberDisplayed += "8";
              }
              updateTextField();
          }
      });
  
      final Button bt9 = (Button) findViewById(R.id.btnNum9Id);
      bt9.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if(inJugada.requestFocus() == true){
                  playDisplayed += "9";
              }else if(inValor.requestFocus() == true){
                  numberDisplayed += "9";
              }
              updateTextField();
          }
      });
  
      final Button btPlus = (Button) findViewById(R.id.btnAddId);
      btPlus.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
  
              if(inJugada.length() == 4){
                  processPale();
  
              }else if(inJugada.length() == 2){
                  processNum();
  
              }else if(inJugada.length() == 6){
                  processTripleta();
  
              }
  
              //processNumbers();
              //showListViewData();
              updateTextField();
              plus = true;
  
  
          }
  
      });
  
      final Button btBs = (Button) findViewById(R.id.btnAtras);
      btBs.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              if (numberDisplayed.length() &gt;= 1) {
                  numberDisplayed = numberDisplayed.substring(0,
                          numberDisplayed.length() - 1);
              }
  
              if (playDisplayed.length() &gt;= 1) {
                  playDisplayed = playDisplayed.substring(0,
                          playDisplayed.length() - 1);
              }
              updateTextField();
          }
      });
  
      final Button btClear = (Button) findViewById(R.id.btnClearId);
      btClear.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              numberDisplayed = "";
              playDisplayed = "";
              storedNumber = "";
              plus = false;
              resultNumber = 0d;
              inValor.clearFocus();
              updateTextField();
              mData.clear();
              mAdapter.notifyDataSetChanged();
          }
      });
  
  
  private void processNumbers() {
  
      if (plus) {
          resultNumber = calc.sum(Double.parseDouble(numberDisplayed),
                  resultNumber); //create a sum
      }else{
          resultNumber = new Double(numberDisplayed);
      }
      numberDisplayed = "";
      updateTextField();
  }
  </code></pre>