title: Android StringArray with settext
body: <p>I'm developing an app that displays some textviews for the user, and I thought that I would store the text in an array and load the information accordingly to chosen item from a listview</p>
  
  <p>Each StringArray has a name and 4 items. I'm using an if statement to know which array to use and then set the text accordingly.</p>
  
  <p>However I can't get it right it seems.. LogCat gives me FATALEXCEPTION and the program closes right away when I try to access the activity.</p>
  
  <p>Used code</p>
  
  <pre><code>if (s.equals("A_DuGamla")) {
      String[] banan_arr = getResources().getStringArray(R.array.hello);
      songname.setText(banan_arr[0]);
      lyricsby.setText(banan_arr[1]);
      melody.setText(banan_arr[2]);
      lyrics.setText(banan_arr[3]);
  } else if (s.equals("A_Kungs")) { 
  // And so on..
  </code></pre>
  
  <p>And the StringArray</p>
  
  <pre><code>&lt;string-array name="hello"&gt;
      &lt;item&gt;Visa&lt;/item&gt;
      &lt;item&gt;Text&lt;/item&gt;
      &lt;item&gt;Melodi&lt;/item&gt;
      &lt;item&gt;Text&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p>thanks in advance</p>
  
  <p>UPDATE ERROR LOG</p>
  
  <pre><code>05-13 21:05:20.771: E/AndroidRuntime(25903): FATAL EXCEPTION: main
  05-13 21:05:20.771: E/AndroidRuntime(25903): java.lang.RuntimeException: Unable toinstantiate activity ComponentInfo{se.noxious.visboken/se.noxious.visboken.R1_TradVisor}: java.lang.NullPointerException
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1743)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1851)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.app.ActivityThread.access$1500(ActivityThread.java:132)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.os.Handler.dispatchMessage(Handler.java:99)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.os.Looper.loop(Looper.java:150)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.app.ActivityThread.main(ActivityThread.java:4277)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at java.lang.reflect.Method.invokeNative(Native Method)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at java.lang.reflect.Method.invoke(Method.java:507)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at dalvik.system.NativeStart.main(Native Method)
  05-13 21:05:20.771: E/AndroidRuntime(25903): Caused by: java.lang.NullPointerException
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:356)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:351)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at se.noxious.visboken.R1_TradVisor.&lt;init&gt;(R1_TradVisor.java:19)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at java.lang.Class.newInstanceImpl(Native Method)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at java.lang.Class.newInstance(Class.java:1409)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.app.Instrumentation.newActivity(Instrumentation.java:1040)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1735)
  05-13 21:05:20.771: E/AndroidRuntime(25903):    ... 11 more
  </code></pre>