Track amount of clicks user clicks button
<p>I was wandering if there was any way to track the amount of clicks a user clicks a button. </p>

<p>I am creating a game and the user will only be allowed to take 5 turns. After these turns the user has lost the game.</p>

<p>I need to create maybe an if statement where the amount of clicks the user takes reaches > 5 then the user has lost. Is this possible. </p>

<p>I appreciate any help on this. Thanks</p>

<p>Edit: </p>

<pre><code>Button link2Btn = (Button)findViewById( R.id.answerSelected );
</code></pre>

<p>link2Btn.setOnClickListener( new View.OnClickListener()
{
public void onClick(View v)
{
    i++;</p>

<p>getAnswer();
    }</p>

<p>The get Answer method works fine except the if i > 5 statement within get Answer which is:</p>

<pre><code>else if(i&gt;5){
    correctAnswer.setText("You have lost");
</code></pre>
