title: How to change second spinner array when selecting in first spinner android
body: <p>I have two spinners, when I select first spinner, based on first spinner selection, second spinner arrays to get change.How to do that.</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;resources&gt;
      &lt;string-array name="type"&gt;
          &lt;item&gt;Select Type&lt;/item&gt;
          &lt;item &gt;Color&lt;/item&gt;
          &lt;item &gt;Weeks&lt;/item&gt;
        &lt;/string-array&gt;
  
      &lt;string-array name="color"&gt;
          &lt;item&gt;Blue&lt;/item&gt;
          &lt;item &gt;Orange&lt;/item&gt;
          &lt;item &gt;Red&lt;/item&gt;
          &lt;item &gt;Green&lt;/item&gt;
         &lt;/string-array&gt;
  
       &lt;string-array name="weeks"&gt;
          &lt;item&gt;Sunday&lt;/item&gt;
          &lt;item &gt;Monday&lt;/item&gt;
          &lt;item &gt;Tuesday&lt;/item&gt;
          &lt;item &gt;Wednesday&lt;/item&gt;
                &lt;/string-array&gt;
  
  &lt;/resources&gt;
  
    &lt;TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Select Type:"/&gt;
  
    &lt;Spinner
    android:id="@+id/spinner"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:prompt="@string/spinner_title"
    android:drawSelectorOnTop = "true"/&gt;
  
  
      &lt;Spinner
      android:id="@+id/spinner1"
      android:layout_width="match_parent"
            android:prompt="@string/spinner_title1"
      android:layout_height="wrap_content" /&gt;
  
      ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(
              this, R.array.type, android.R.layout.simple_spinner_item);
  
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      spinner.setAdapter(adapter);
  </code></pre>
  
  <p>In this two spinners, in first spinner, i have used "type", based on the selection of type of first spinner, how to change second spinner to use the array color and weeks?</p>
  
  <p>Thanks in advance</p>