title: Passing parameter from method to OnClickListener
body: <p>I want to pass the string "Jawab" to the method Proses and to the OnClick to compare data from database and data from the EditText when i click the submit button, but the String Jawab cannot be detected in the OnClick Method. See the code below.</p>
  
  <pre><code>public void LoadSoal(int a, DataAdapter x)
  {       
      Cursor testdata = x.getTestData(a);
      String Soal = Utility.GetColumnValue(testdata, "soal");
      String Jawab = Utility.GetColumnValue(testdata, "jawab");
  
      TextView textSoal = (TextView)findViewById(R.id.tekssoal);
      textSoal.setText(Soal);
      Proses(Jawab);
  }
  
  public void Proses(String x)
  {               
      btnsubmit.setOnClickListener(new View.OnClickListener()
      {
      public void onClick(View v)
      {
          int skor = 0;
          TextView textScore = (TextView)findViewById(R.id.teksskor);
          EditText teksJawab = (EditText)findViewById(R.id.teksjawab);
  
          String jawaban = teksJawab.getText().toString();
  
          // TODO Auto-generated method stub
          if (x.equals(jawaban))
              {
                  skor = skor + 10;
                  textScore.setText(skor);
              }
          else
          {
              skor = skor + 0;
              textScore.setText(skor);
          }
      }
  });
  }
  </code></pre>
  
  <p>}</p>