NullpointerException on string-array android xml
<p>Good day, Any idea why i could be getting a NullPointerException in the following code. I am trying to retrieve elements from a string-array in XML and test against a given value but i keep getting a NullpointerException on the first line of the code below.</p>

<pre><code> String [] position = context.getResources().getStringArray(R.array.google_weather_conditions); // NullpointerException here        
            for(String check: position){
               String test_condition = check;
               if(this.condition.equals(test_condition)){
                  weather_conditions = test_condition;
               }
                    }
</code></pre>

<p>here is the strings.xml file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;resources&gt;
     &lt;string name="Clear"&gt;Clear&lt;/string&gt;
     &lt;string name="Sunny"&gt;Sunny&lt;/string&gt;
     &lt;string name="Mostly_Sunny"&gt;Mostly Sunny&lt;/string&gt;
     &lt;string name="Partly_Sunny"&gt;Partly Sunny&lt;/string&gt;
     &lt;string name="Cloudy"&gt;Cloudy&lt;/string&gt;
    &lt;string name="Mostly_Cloudy"&gt;Mostly Cloudy&lt;/string&gt;
    &lt;string name="Partly_Cloudy"&gt;Partly Cloudy&lt;/string&gt;
    &lt;string name="Rain"&gt;Rain&lt;/string&gt;

     &lt;string-array name="google_weather_conditions"&gt;
            &lt;item&gt;@string/Clear&lt;/item&gt;
            &lt;item&gt;@string/Sunny&lt;/item&gt;
            &lt;item&gt;@string/Mostly_Sunny&lt;/item&gt;
            &lt;item&gt;@string/Partly_Sunny&lt;/item&gt;
            &lt;item&gt;@string/Cloudy&lt;/item&gt;
            &lt;item&gt;@string/Mostly_Cloudy&lt;/item&gt;
            &lt;item&gt;@string/Partly_Cloudy&lt;/item&gt;
            &lt;item&gt;@string/Rain&lt;/item&gt;
        &lt;/string-array&gt;


    &lt;/resources&gt;
</code></pre>
