title: Populate a listView from string resources in Android
body: <p>I am trying to populate a listview from the string resources defined in the string XML file in Android.
  I am not getting any errors but when I run the application it asks me to force close.
  I am getting the following error in log cat manager
      03-26 01:04:42.903: E/dalvikvm(205): Unable to open stack trace file   '/data/anr/traces.txt': Permission denied</p>
  
  <p>Here is the code for my program</p>
  
  <pre><code>public class MainMenu extends Activity {
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.menu);
  
      /*ListView menu = (ListView) findViewById(R.id.ListView_Menu);
  
      String[] items = { getResources().getString(R.string.today_bd),getResources().getString(R.string.Add_bd),
              getResources().getString(R.string.msg_tmplate),getResources().getString(R.string.credits),
              getResources().getString(R.string.help)
      };
  
      ArrayAdapter&lt;String&gt; adapt = new ArrayAdapter&lt;String&gt;(this,R.layout.menu,items);
  
      menu.setAdapter(adapt);*/
      ListView menuList = (ListView) findViewById(R.id.ListView_Menu);
      String[] items = { getResources().getString(R.string.today_bd),
              getResources().getString(R.string.add_bd),
              getResources().getString(R.string.msg_tmplate),
              getResources().getString(R.string.credits),
              getResources().getString(R.string.help)
              };
  
      ArrayAdapter&lt;String&gt; adapt = new ArrayAdapter&lt;String&gt;(this, R.layout.menu, items);
      menuList.setAdapter(adapt);
      menuList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          public void onItemClick(AdapterView&lt;?&gt; parent, View itemClicked, int position, long id) {
  
              TextView textView = (TextView) itemClicked;
              String strText = textView.getText().toString();
              if (strText.equalsIgnoreCase(getResources().getString(R.string.today_bd))) {
  
                  //startActivity(new Intent(QuizMenuActivity.this, QuizGameActivity.class));
              } else if (strText.equalsIgnoreCase(getResources().getString(R.string.add_bd))) {
                  // Launch the Help Activity
                  //startActivity(new Intent(QuizMenuActivity.this, QuizHelpActivity.class));
              } else if (strText.equalsIgnoreCase(getResources().getString(R.string.msg_tmplate))) {
                  // Launch the Settings Activity
                  //startActivity(new Intent(QuizMenuActivity.this, QuizSettingsActivity.class));
              } else if (strText.equalsIgnoreCase(getResources().getString(R.string.credits))) {
                  // Launch the Scores Activity
                 // startActivity(new Intent(QuizMenuActivity.this, QuizScoresActivity.class));
              }
              else if (strText.equalsIgnoreCase(getResources().getString(R.string.help))) {
                  // Launch the Scores Activity
                 // startActivity(new Intent(QuizMenuActivity.this, QuizScoresActivity.class));
              }
          }
  
  
          //public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
                  //long arg3) {
              // TODO Auto-generated method stub
  
          //}
      });
  
  
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Please help!!!</p>