Is is safe to pass an Android Button object outside of an OnClick() handler?
<p>OK I really need to know if I can pass the button out to a method like this or not. Am I going about this right? I am a major Java newbie same with the TextView as well I guess I would assume they would act the same, I have tried searching but can't seem to find anything. Eclipse isn't throwing any wobblies and the app runs fine until I press a button then it crashes with a resource exception. Thanks in adavance :)</p>

<pre><code>b1.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            gameTurnLogic(player, 0, b1, myTv);
        }
    });
</code></pre>

<p>}</p>

<pre><code>public void gameTurnLogic(boolean p, int buttonNumb, Button button, TextView textview){
    if(player == true &amp;&amp; board[buttonNumb] == 0){
        board[buttonNumb] = 1;
        player = false;
        btnText(button, 'O');
        textview.setText("Player 2's Turn");
        checkWin(textview);
    }
    else if(player == false &amp;&amp; board[buttonNumb] == 0){
        board[buttonNumb] = 2;
        player = true;
        btnText(button, 'X');
        textview.setText("Player 1's Turn");
        checkWin(textview);
    }
    else if(player == true &amp;&amp; board[buttonNumb] != 0){
        textview.setText("location already used!");
    }
    else if(player == false &amp;&amp; board[buttonNumb] != 0){
        textview.setText("location already used!");
    }
}
</code></pre>
