title: android :populating spinner based on another spinner selection
body: <p><code>spinner</code> is not populating based on the another <code>spinner selection</code> , I have been on this for hours , still can't get the issue , <strong>No error in LOGCAT</strong>. Thanks in advance.</p>
  
  <p><strong>This is my code</strong></p>
  
  <pre><code> ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
              android.R.layout.simple_dropdown_item_1line, SPINNERCOUNTRY);
  
      spinnerCountry = (MaterialBetterSpinner) findViewById(R.id.spinnerState);
  
      spinnerCountry.setAdapter(adapter);
  
      spinnerCity = (Spinner) findViewById(R.id.spinnerCity);
  
  
      spinnerCountry.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view, int pos, long l) {
              adapterView.getItemAtPosition(pos);
              if (pos == 0) {
                  ArrayAdapter&lt;CharSequence&gt; adapter =  ArrayAdapter
                          .createFromResource(SpinnerStateCitySelectorActivity.this, R.array.city_Tamil_Nadu,
                                  android.R.layout.simple_spinner_dropdown_item);
                  spinnerCity.setAdapter(adapter);
              } else if (pos == 1) {
                  ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter
                          .createFromResource(SpinnerStateCitySelectorActivity.this, R.array.city_Kerela,
                                  android.R.layout.simple_spinner_dropdown_item);
                  spinnerCity.setAdapter(adapter);
              } else if (pos == 2) {
                  ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter
                          .createFromResource(SpinnerStateCitySelectorActivity.this, R.array.city_Karnataka,
                                  android.R.layout.simple_spinner_dropdown_item);
                  spinnerCity.setAdapter(adapter);
              }
          }
  
          @Override
          public void onNothingSelected(AdapterView&lt;?&gt; adapterView) {
  
          }
      });
  </code></pre>