title: Spinner in fragments pop up delayed
body: <p>I created some fragments in an <code>Activity</code> class as tabs where you can switch through and inside these I have various <code>Spinner</code>. The data I'm getting from a SQL-database with <code>JSONParser</code> and the <code>Spinner</code> gets created in the <code>fragment</code> classes as follow: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>spinnerMaterial = (Spinner) view.findViewById(R.id.Spinner_material);
  
          List&lt;String&gt; lables_material = new ArrayList&lt;String&gt;();
  
          for (int i = 0; i &lt; materialList.size(); i++) {
              lables_material.add(materialList.get(i).getMaterial());
          }
  
          // Creating adapter for spinner
          ArrayAdapter&lt;String&gt; spinnerAdapter_material = new ArrayAdapter&lt;String&gt;(getActivity(),
                  android.R.layout.simple_spinner_item, lables_material);
  
          // Drop down layout style - list view with radio button
          spinnerAdapter_material
                  .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
          // attaching data adapter to spinner
          spinnerMaterial.setAdapter(spinnerAdapter_material);
  
          // spinner item select listener
          spinnerMaterial.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
  
              @Override
              public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view,
                                         int position, long id) {
                  Object item = adapterView.getItemAtPosition(position);
              }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; adapterView) {
                  // TODO Auto-generated method stub
  
              }
          });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Actually everything is working. I'm getting all the data and the <code>Spinner</code> are poping up. BUT not in a direct way. So I need to switch between the tabs (<code>fragments</code>) and then go back that the <code>Spinner</code> is showing the data. Strange fact is that when I try to debug and go over some <code>breakpoints</code> the <code>Spinner</code> pops up immediately (without switching tabs).</p>
  
  <p>Do you have an idea what the problem could be? </p>