title: How to make `Spinner onItemSelected()` to update `ListView` items from arrays in `strings.xml`?
body: <p>Starting on Android dev here and I have a question regarding the update of a <code>ListView</code>. 
  Following some tutorials I was able to make:</p>
  
  <ul>
  <li><code>Spinner</code> with 4 items (Client A, Client B, Client C, Client D);</li>
  <li><code>ListView</code> with <code>Checkbox</code> and a <code>TextView</code> saying the projects of each Client;</li>
  </ul>
  
  <p>Each Client has is own Projects and the idea is to update the <code>ListView</code> to show each client projects when selecting them in the <code>Spinner</code>, e.g: </p>
  
  <ol>
  <li><code>Client A</code> -> Project 1, Project 2, Project 3, (...), Project 7; </li>
  <li><code>Client B</code> -> Project 8, Project 9, (...), Project 16.</li>
  </ol>
  
  <p>For this I use a <code>Base Adapter</code> refering to a <code>single_row.xml</code> to set the layout for each view.</p>
  
  <p>The information about the clients is set on an array called <code>clientes_array</code> in the <code>strings.xml</code> file. There I also have arrays for the <code>projectsA</code> and <code>projectsB</code>.</p>
  
  <p><code>strings.xml</code>:</p>
  
  <p><code>&lt;string-array name="clientes_array"&gt;
          &lt;item&gt;Cliente A&lt;/item&gt;
          &lt;item&gt;Cliente B&lt;/item&gt;
          &lt;item&gt;Cliente C&lt;/item&gt;
          &lt;item&gt;Cliente D&lt;/item&gt;
      &lt;/string-array&gt;
      &lt;string-array name="projectoA"&gt;
          &lt;item&gt;Projecto #1&lt;/item&gt;
          &lt;item&gt;Projecto #2&lt;/item&gt;
          &lt;item&gt;Projecto #3&lt;/item&gt;
          &lt;item&gt;Projecto #4&lt;/item&gt;
          &lt;item&gt;Projecto #5&lt;/item&gt;
          &lt;item&gt;Projecto #6&lt;/item&gt;
          &lt;item&gt;Projecto #7&lt;/item&gt;
      &lt;/string-array&gt;
      &lt;string-array name="projectoB"&gt;
          &lt;item&gt;Projecto #8&lt;/item&gt;
          &lt;item&gt;Projecto #9&lt;/item&gt;
          &lt;item&gt;Projecto #10&lt;/item&gt;
          &lt;item&gt;Projecto #11&lt;/item&gt;
          &lt;item&gt;Projecto #12&lt;/item&gt;
          &lt;item&gt;Projecto #13&lt;/item&gt;
          &lt;item&gt;Projecto #14&lt;/item&gt;
          &lt;item&gt;Projecto #15&lt;/item&gt;
          &lt;item&gt;Projecto #16&lt;/item&gt;
      &lt;/string-array&gt;</code></p>
  
  <p>This is my <code>Activity</code> code: </p>
  
  <p>`public class AddProj_Activity extends Activity implements
          AdapterView.OnItemSelectedListener {</p>
  
  <pre><code>Spinner spinner1;
  Button botaoAdd;
  ListView listView;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.addproj_layout);
  
      spinner1 = (Spinner) findViewById(R.id.spinner1);
      botaoAdd = (Button) findViewById(R.id.addProj);
      listView = (ListView) findViewById(android.R.id.list);
  
      listView.setAdapter(new Adaptador(this));
  
      ArrayAdapter adapter2 = ArrayAdapter.createFromResource(this,
              R.array.clientes_array, R.layout.spinner_item);
      adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      spinner1.setAdapter(adapter2);
  
      spinner1.setOnItemSelectedListener(this);
  
  }
  
  @Override
  public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position,
          long id) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onNothingSelected(AdapterView&lt;?&gt; parent) {
      // TODO Auto-generated method stub
  
  }
  
  class SingleRow {
      String projecto;
  
      public SingleRow(String projecto) {
          // TODO Auto-generated constructor stub
          this.projecto = projecto;
      }
  
  }
  
  class Adaptador extends BaseAdapter {
  
      ArrayList&lt;SingleRow&gt; listSR;
      Context context;
  
      public Adaptador(Context c) {
          // TODO Auto-generated constructor stub
          context = c;
          listSR = new ArrayList&lt;SingleRow&gt;();
  
          Resources res = c.getResources();
          String[] projecto = res.getStringArray(R.array.projectoA);
  
          for (int i = 0; i &lt; projecto.length; i++) {
              listSR.add(new SingleRow(projecto[i]));
          }
      }
  
      @Override
      public int getCount() {
          // TODO Auto-generated method stub
          return listSR.size();
      }
  
      @Override
      public Object getItem(int i) {
          // TODO Auto-generated method stub
          return listSR.get(i);
      }
  
      @Override
      public long getItemId(int i) {
          // TODO Auto-generated method stub
          return i;
      }
  
      @Override
      public View getView(int i, View view, ViewGroup viewGroup) {// call to each row
          // TODO Auto-generated method stub
  
          // Inflater -&gt; goes toxml, reads properties and creates the object with those properties!
          // new object everytime: layout inflater || same object everytime:
          // findViewById
          LayoutInflater inflater = (LayoutInflater) context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          View row = inflater.inflate(R.layout.single_row, viewGroup, false);// ref to RelativeLayout
          TextView tV = (TextView) row.findViewById(R.id.textView1);
          CheckBox cBx = (CheckBox) row.findViewById(R.id.checkbox);
  
          SingleRow temp = listSR.get(i);
  
          tV.setText(temp.projecto);
  
          return row;
      }
  
  }
  </code></pre>
  
  <p>}`</p>
  
  <p>How can I get a specific client to get the array of projects?</p>
  
  <p><code>Client A</code> getting all the <code>projectsA</code>, <code>Client B</code> getting all the <code>projectsB</code>, etc. ??</p>
  
  <p>What should I do now?</p>
  
  <p>Thanks in advance!</p>