Loading string from string array in strings.xml file
<p>I am using the following piece of code in my app:</p>

<pre><code>string_array = getResources().getStringArray(R.array.array_of_strings);
my_text_view.setText(string_array[i]);
</code></pre>

<p>The problem is that I start the activity which contains this code many times.
So, I feel that this code is inefficient as every time i start the activity i have to load the whole array to just use one element specially as the string array is very large.</p>

<p>Is there a way to load the wanted element directly?</p>

<p>Thanks a lot in advance :)</p>

<p>update:
I tried using Application object as Talihawk stated below, but i get an error at the following line:</p>

<pre><code>MyApplication my_obj = (MyApplication) getApplication();
string_array = my_obj.getStringArray(); 
</code></pre>

<p>The Error is:</p>

<p>android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)</p>
