title: Adding array strings from String.xml into ArrayList
body: <p>I am defining array strings into String.xml. Then I am going to add them into ArrayList. But I got an empty list. </p>
  
  <p>String.xml:</p>
  
  <pre><code>&lt;array name="restaurant_names"&gt;
      &lt;item &gt;Tobaz&lt;/item&gt;
      &lt;item &gt;Lozanna&lt;/item&gt;
      &lt;item &gt;Vetameen&lt;/item&gt;
      &lt;item &gt;Baharat&lt;/item&gt;
  &lt;/array&gt; 
  </code></pre>
  
  <p>Java class: </p>
  
  <pre><code>ArrayList&lt;RestaurantObjects&gt; restaurant;
  String name;
  String type;
  restaurant = new ArrayList&lt;&gt;();
  
  for(int i=0;i&gt;=R.array.restaurant_names;i++) {
     name = getResources().getStringArray(R.array.restaurant_names)[i];
     type = getResources().getStringArray(R.array.restaurant_names)[i];
     restaurant.add(new RestaurantObjects(name, type));
  }
  
  restaurantList.setAdapter(new ListAdapter(this,restaurant));
  </code></pre>
  
  <p>I tried to do it without the loop and it works perfect. is there something wrong with the for loop.  </p>