title: Android - Updating list view on spinner selection
body: <p>I am trying to update a list view, when I select on an item in spinner, the code works but no output is generated. I cannot figure out the bug.On every click on the item in spinner I want to view different list.</p>
  
  <pre><code>Spinner spinner;
  String path[] = {"Laptops","DesktopPC","Tablets","Add-Ons","Gaming"};
  String Laptops[] = {"Dell","Hp","Apple"};
  ListView lstView;
  
  
  lstView = (ListView) findViewById(R.id.listView1);
  
  ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt; (Category.this, android.R.layout.simple_spinner_item, path );
  spinner = (Spinner) findViewById(R.id.spinner1);
  spinner.setAdapter(adapter);
  spinner.setOnItemClickListener(new OnItemClickListener() {
  
      @Override
      public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,
              int arg2, long arg3) {
          // TODO Auto-generated method stub
          ArrayAdapter&lt;String&gt; lstAdapter = new ArrayAdapter&lt;String&gt;(getApplicationContext(), android.R.layout.simple_list_item_1, Laptops);
          lstView.setAdapter(lstAdapter);
          //lstView.refreshDrawableState();
  
      }
  });
  </code></pre>