title: Android - Dynamic form with Spinner
body: <p>I have a <code>Spinner</code> in an <code>Activity</code> and some text fields in the same <code>Activity</code>.</p>
  
  <p>I want to make the text fields dynamic, and show specific fields, depends on the selection the user made on the <code>Spinner</code>.</p>
  
  <p>I have this code in my class:</p>
  
  <pre><code>spinner_type.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){        
  
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) {
          Toast.makeText(getApplicationContext(), position, Toast.LENGTH_SHORT).show();
          if (position == 1){
              Toast.makeText(getApplicationContext(), position, Toast.LENGTH_SHORT).show();
          }
      }
  
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; parentView) {
          // your code here
      }
  });
  </code></pre>
  
  <p>this isn't working.</p>