title: Android string-array from xml file to ListView
body: <p>First of all, thank you for your answers! I'm new for Android and this is my problem; </p>
  
  <p>I want to take values of string array to listview. </p>
  
  <p>Program works fine with these codes:</p>
  
  <pre><code>private String [] fiilliste={"A","Ağlamak","Almak","B","Bulmak"};
  ArrayAdapter&lt;String&gt; adapter;
  adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, fiilliste);
  vlist.setAdapter(adapter);
  </code></pre>
  
  <p>But I wanna use xml file for string-array. This is my xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
  
       &lt;string-array name="fi"&gt;
          &lt;item&gt;A&lt;/item&gt;
        &lt;item&gt;Almak&lt;/item&gt;
        &lt;item&gt;Anlamak&lt;/item&gt;
        &lt;item&gt;Anlasmak&lt;/item&gt;
        &lt;item&gt;Anlatmak&lt;/item&gt;
        &lt;item&gt;Ayrilmak&lt;/item&gt;
      &lt;/string-array&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>and I just changed the code with following code, and now program doesn't work.</p>
  
  <pre><code>String [] fiilliste= getResources().getStringArray(R.array.fi);
  </code></pre>
  
  <p>Can you help me to solve this problem? Thank you!</p>
  
  <p>Activity codes:</p>
  
  <pre><code>package com.gazi.tezproje;
  
  import android.app.ActionBar;
  import android.app.Activity;
  import android.os.Bundle;
  import android.text.Editable;
  import android.text.TextWatcher;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.AdapterView.OnItemClickListener;
  import android.widget.ArrayAdapter;
  import android.widget.EditText;
  import android.widget.ImageButton;
  import android.widget.ListView;
  import android.widget.Toast;
  
  public class verbs extends Activity {
  
      public boolean onCreateOptionsMenu(Menu menu) {
          ActionBar bar=getActionBar(); 
          bar.setDisplayHomeAsUpEnabled(true);
  
          MenuInflater menu1 = getMenuInflater();
          menu1.inflate(R.menu.info, menu);
  
  
          return super.onCreateOptionsMenu(menu);
      }
  
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case R.id.menuinfo:
              Toast.makeText(getApplicationContext(),getString(R.string.verbs), Toast.LENGTH_LONG).show();
              break; 
              case android.R.id.home:
              finish();
              break;
          }
          return false;
      }
  
      private ListView vlist;
      EditText ara;
  
      String [] fiilliste= getResources().getStringArray(R.array.fi);
      ArrayAdapter&lt;String&gt; adapter;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.verbs);
  
          vlist=(ListView)findViewById(R.id.listView1);
  
          adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, fiilliste);
  
          vlist.setAdapter(adapter);
          ara = (EditText) findViewById(R.id.editText1);
          vlist.setTextFilterEnabled(true);
          ara.addTextChangedListener(new TextWatcher(){
              public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
                  /* When user changed the Text */
                  verbs.this.adapter.getFilter().filter(cs);   
              }
  
              @Override
              public void afterTextChanged(Editable arg0) {
                  /*TODO Auto-generated method stub*/
              }
  
              @Override
              public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
                  int arg3) {
                  /*TODO Auto-generated method stub*/
              }
          });
      }
  }
  </code></pre>