giving short value's in if blocks and give them to another method in different activity
<p>I've got a piece of code that gives short gridSize a value onclick(that's what I hope it does, if you see any mistakes please correct me). but for now it doesn't do anything yet...</p>

<p>the code that gives the short values: </p>

<pre><code>public static short getGridSize(PuzzleActivity puzzleActivity, ImageButton view)  {
        if ( mIbtn3x3 == view) {
            String puzzle3 = "3";
            Short gridSize = Short.parseShort(puzzle3);
        } else if (mIbtn4x4 == view ) {
            String puzzle4 = "4";
            Short gridSize = Short.parseShort(puzzle4);
        } else if (mIbtn5x5 == view ) {
            String puzzle5 = "5";
            Short gridSize = Short.parseShort(puzzle5);
        }
        return Short.parseShort(PuzzleActivity.gridSize);
    } 
</code></pre>

<p>the code that should receive the value (puzzle activity):</p>

<pre><code> createGameBoard(SizeSelection.getGridSize(this));
            break;
</code></pre>

<p>in the if block code : gridSize gets the following error : "gridSize cannot be resolved or is not a field".</p>

<p>in the PuzzleActivity code : .getGridSize gets the following error : "The method getGridSize(PuzzleActivity, ImageButton) in the type SizeSelection is not applicable for the arguments (PuzzleActivity)". </p>

<p>clearly I'm not a professional coder. please help me fixing this. thanks in advance ~olijf</p>
