title: 2 Dropdowns State and City, set the city string-array based on state selected
body: <p>I am building a cab booking app. This app needs to provide a feature to the cab driver to specify which city he will operate from. To enhance the experience, I need to provide a <code>Select State</code> drop down and then a <code>Select City</code> dropdown.</p>
  
  <p>The states are listed in a string-array like this.</p>
  
  <pre><code>&lt;string-array name="stateArray"&gt;
      &lt;item&gt;Andaman and Nicobar Islands&lt;/item&gt;
      &lt;item&gt;Andhra Pradesh&lt;/item&gt;
      &lt;item&gt;Arunachal Pradesh&lt;/item&gt;
      &lt;item&gt;Assam&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p>The city's are listed in a string-array like this.</p>
  
  <pre><code>&lt;string-array name="AndhraPradesh"&gt;
      &lt;item&gt;Adilabad&lt;/item&gt;
      &lt;item&gt;Adoni&lt;/item&gt;
      &lt;item&gt;Amadalavalasa&lt;/item&gt;
      &lt;item&gt;Amalapuram&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p>In the listeners I have</p>
  
  <p>Setting the states is really easy in the layout xml file <code>android:entries="@array/stateArray"</code>. </p>
  
  <p>I have seen many other stackoverflow questions recommending the ArrayList and setAdapter. I am wondering if there is a relatively easy way to set the entries for the city too, programmatically depending on the state selected.</p>