title: Robolectric Testing: can not get the locale
body: <p>I'm using robolectric framework to test my android project. It is working very well but i couldn't find how to solve the problem:</p>
  
  <p>In my activity class, i have to take the current language as follows:</p>
  
  <pre><code>private void setCurrentLanguageChoosenInRadioGroup() {
      Configuration c = new Configuration(getResources().getConfiguration());
      String locale = c.locale.getLanguage();
  
      if(locale.equalsIgnoreCase(Constants.DUTCH_LANGUAGE)){          
          radioLanguageGroup.check(dutchButton.getId());
      }
      else if(locale.equalsIgnoreCase(Locale.FRENCH.getLanguage())){
          radioLanguageGroup.check(frenchButton.getId());
      }
      else if(locale.equalsIgnoreCase(Locale.ENGLISH.getLanguage())){
          radioLanguageGroup.check(englishButton.getId());
      }
  }
  </code></pre>
  
  <p>But in the line of "c.locale.getLanguage();" i get nullpointerexception. It is my testing method:</p>
  
  <pre><code>public void setUp() throws Exception {
      activity = new MainActivity();
      activity.onCreate(null); ....
  </code></pre>
  
  <p>Has anybody a idea what is the problem and how can it be solved?</p>