title: Setting the value of a int on button click
body: <p>How do I set the value of a int when clicking a button?</p>
  
  <p>I tried this:</p>
  
  <pre><code>    final int a1_val = 0;
  
      a1_btn.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {a1_val= a1_val+1;;};});
  </code></pre>
  
  <p>But it is saying that : The final local variable a1_val, cannot be assigned since it is defined in an enclosing type.</p>