title: Android application with ActionBar NullPointerException with non default locale
body: <p>I created pretty basic Android application with ActionBar and 2 tabs. It worked OK. Then I added locale resource directory <code>res/values-de</code> and inside it <code>strings.xml</code> with strings translated in German language. I changed language on my Nexus7 to German and application is unable to start after deployment. I got the same problem on emulator. </p>
  
  <p>Please can you help me make this application running with some non default locale on my mobile device? In my case German...</p>
  
  <p>Following error is reported.</p>
  
  <pre><code>02-07 15:32:41.314: W/dalvikvm(16682): threadid=1: thread exiting with uncaught exception (group=0x40d82930)
  02-07 15:32:41.324: E/AndroidRuntime(16682): FATAL EXCEPTION: main
  02-07 15:32:41.324: E/AndroidRuntime(16682): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tabactionbar/com.example.tabactionbar.MainActivity}: java.lang.NullPointerException
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.os.Handler.dispatchMessage(Handler.java:99)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.os.Looper.loop(Looper.java:137)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.app.ActivityThread.main(ActivityThread.java:5039)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at java.lang.reflect.Method.invokeNative(Native Method)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at java.lang.reflect.Method.invoke(Method.java:511)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at dalvik.system.NativeStart.main(Native Method)
  02-07 15:32:41.324: E/AndroidRuntime(16682): **Caused by: java.lang.NullPointerException
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at com.example.tabactionbar.MainActivity.onCreate(MainActivity.java:20)**
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.app.Activity.performCreate(Activity.java:5104)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
  02-07 15:32:41.324: E/AndroidRuntime(16682):    ... 11 more
  02-07 15:32:41.334: W/ActivityManager(492):   Force finishing activity com.example.tabactionbar/.MainActivity
  02-07 15:32:41.434: D/dalvikvm(492): GC_FOR_ALLOC freed 546K, 19% free 15994K/19568K, paused 64ms, total 64ms
  02-07 15:32:41.574: D/libgps(492): proxy_gps_nmea_cb()
  </code></pre>
  
  <p><strong>MainActivity code without TabListener:</strong></p>
  
  <pre><code>public class MainActivity extends Activity {
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      ActionBar actionBar = getActionBar();
  
      actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  
      String label1 = getResources().getString(R.string.label1);
      Tab tab = actionBar.newTab();
      tab.setText(label1);
      TabListener&lt;Tab1Fragment&gt; tl = new TabListener&lt;Tab1Fragment&gt;(this,
              label1, Tab1Fragment.class);
      tab.setTabListener(tl);
      actionBar.addTab(tab);
  
      String label2 = getResources().getString(R.string.label2);
      tab = actionBar.newTab();
      tab.setText(label2);
      TabListener&lt;Tab2Fragment&gt; tl2 = new TabListener&lt;Tab2Fragment&gt;(this,
              label2, Tab2Fragment.class);
      tab.setTabListener(tl2);
      actionBar.addTab(tab);          
  } 
  </code></pre>
  
  <p>Reported line 20 in error is 
      <strong>actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);</strong></p>
  
  <p><strong>strings.xml with German</strong> text is
      </p>
  
  <pre><code>&lt;string name="app_name"&gt;TabActionBar&lt;/string&gt;
  &lt;string name="hello_world"&gt;Hello world!&lt;/string&gt;
  &lt;string name="menu_settings"&gt;Settings&lt;/string&gt;
  &lt;string name="title_activity_main"&gt;MainActivity&lt;/string&gt;
  &lt;string name="label1"&gt;Eins&lt;/string&gt;
  &lt;string name="label2"&gt;Zwei&lt;/string&gt;
  &lt;string name="body1"&gt;Erste&lt;/string&gt;
  &lt;string name="body2"&gt;Zweite&lt;/string&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please can you help me make this application running with some non default locale on my mobile device? In my case German...</p>