Better way to handle if statments for multiple text views?
<p>I have some textviews which I want to check them and return the first which is empty. I've managed to do it this way:</p>

<pre><code>public TextView CurrentPos(){

    if (!wordLetter1.getText().toString().equals("*") &amp;&amp;
    !wordLetter2.getText().toString().equals("*") &amp;&amp;
    !wordLetter3.getText().toString().equals("*") &amp;&amp;
    !wordLetter4.getText().toString().equals("*") &amp;&amp;
    !wordLetter5.getText().toString().equals("*") &amp;&amp;    
    !wordLetter6.getText().toString().equals("*") &amp;&amp;
    !wordLetter7.getText().toString().equals("*")){

        if (wordLetter1.getText().toString().equals("") &amp;&amp;
                wordLetter2.getText().toString().equals("") &amp;&amp;
                wordLetter3.getText().toString().equals("") &amp;&amp;
                wordLetter4.getText().toString().equals("") &amp;&amp;
                wordLetter5.getText().toString().equals("") &amp;&amp;  
                wordLetter6.getText().toString().equals("") &amp;&amp;
                wordLetter7.getText().toString().equals(""))
            return wordLetter1;
        else if (!wordLetter1.getText().toString().equals("") &amp;&amp;
                wordLetter2.getText().toString().equals("") &amp;&amp;
                wordLetter3.getText().toString().equals("") &amp;&amp;
                wordLetter4.getText().toString().equals("") &amp;&amp;
                wordLetter5.getText().toString().equals("") &amp;&amp;  
                wordLetter6.getText().toString().equals("") &amp;&amp;
                wordLetter7.getText().toString().equals(""))
            return wordLetter2;
        else if (!wordLetter1.getText().toString().equals("") &amp;&amp;
                !wordLetter2.getText().toString().equals("") &amp;&amp;
                wordLetter3.getText().toString().equals("") &amp;&amp;
                wordLetter4.getText().toString().equals("") &amp;&amp;
                wordLetter5.getText().toString().equals("") &amp;&amp;  
                wordLetter6.getText().toString().equals("") &amp;&amp;
                wordLetter7.getText().toString().equals(""))
            return wordLetter3;
        else if (!wordLetter1.getText().toString().equals("") &amp;&amp;
                !wordLetter2.getText().toString().equals("") &amp;&amp;
                !wordLetter3.getText().toString().equals("") &amp;&amp;
                wordLetter4.getText().toString().equals("") &amp;&amp;
                wordLetter5.getText().toString().equals("") &amp;&amp;  
                wordLetter6.getText().toString().equals("") &amp;&amp;
                wordLetter7.getText().toString().equals(""))
            return wordLetter4;
        else if (!wordLetter1.getText().toString().equals("") &amp;&amp;
                !wordLetter2.getText().toString().equals("") &amp;&amp;
                !wordLetter3.getText().toString().equals("") &amp;&amp;
                !wordLetter4.getText().toString().equals("") &amp;&amp;
                wordLetter5.getText().toString().equals("") &amp;&amp;  
                wordLetter6.getText().toString().equals("") &amp;&amp;
                wordLetter7.getText().toString().equals(""))
            return wordLetter5;
        else if (!wordLetter1.getText().toString().equals("") &amp;&amp;
                !wordLetter2.getText().toString().equals("") &amp;&amp;
                !wordLetter3.getText().toString().equals("") &amp;&amp;
                !wordLetter4.getText().toString().equals("") &amp;&amp;
                !wordLetter5.getText().toString().equals("") &amp;&amp; 
                wordLetter6.getText().toString().equals("") &amp;&amp;
                wordLetter7.getText().toString().equals(""))
            return wordLetter6;
        else if (!wordLetter1.getText().toString().equals("") &amp;&amp;
                !wordLetter2.getText().toString().equals("") &amp;&amp;
                !wordLetter3.getText().toString().equals("") &amp;&amp;
                !wordLetter4.getText().toString().equals("") &amp;&amp;
                !wordLetter5.getText().toString().equals("") &amp;&amp; 
                !wordLetter6.getText().toString().equals("") &amp;&amp;
                wordLetter7.getText().toString().equals(""))
            return wordLetter7;

    }   
    return null;
}
</code></pre>

<p>The above works fine, but I think that must be a more compat way to achive the same with a less lines of code. I haven't much experience on java and I found some answers for similar situations, which I cannot fully understand.
I tried to reduse my code for CurrentPos() method with the above code:</p>

<pre><code>public TextView CurrentPos(){

    TextView wordletters[] = {wordLetter1, wordLetter2, wordLetter3,
            wordLetter4, wordLetter5, wordLetter6, wordLetter7};

    TextView currentPos = null;
    for(int i=0; i&lt;wordletters.length; i++){
    if(!wordletters[i].toString().equals(("*")) &amp;&amp; wordletters[i].equals("")){      
        currentPos = wordletters[i];
        return currentPos;
        }

        }   
    return null;
}
</code></pre>

<p>which gives error NulPointerException. Obviously I'm doing something wrong, which I don't get it.
Is my code completely wrong or just something missing? </p>
