List View Error in Android
<p>This is my code , I am getting error in this line:</p>

<pre><code>String[] opt = getResources().getStringArray(R.array.MainActivity);
</code></pre>

<p>So, please check my code and say me how to solve the error in that line</p>

<pre><code>public class MainActivity extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    try {
        String[] opt = getResources().getStringArray(R.array.MainActivity);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ListView lv = getListView();
        ListAdapter la = new ArrayAdapter&lt;String&gt;(this,
                android.R.layout.simple_list_item_1, opt);
        lv.setAdapter(la);
        lv.setTextFilterEnabled(true);
        lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

lv.setOnItemClickListener(new OnItemClickListener() {

            public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                    int position, long id) {

                switch (position) {
                case 0:
                    Intent firstIntent = new Intent(MainActivity.this,
                            After1.class);
                    startActivity(firstIntent);
                    break;
                case 1:
                    Intent secondIntent = new Intent(MainActivity.this,
                            After2.class);
                    startActivity(secondIntent);
                    break;

  default:
                    break;
                }

            }
</code></pre>
