title: how to change imageview view based on spinner selection in android studio?
body: <p>I am trying to display image in image view, based on spinner selection. If anyone know how to solve this please help.</p>
  
  <pre class="lang-java prettyprint-override"><code>public class activity_tables extends AppCompatActivity {
  
      Spinner s1;
      String[] tbls;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_tables);
  
          s1 = (Spinner)findViewById(R.id.spinner);
  
  
          tbls = getResources().getStringArray(R.array.tables);
            final ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item,tbls);
            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            s1.setAdapter(adapter);
      }
  }
  
  </code></pre>