title: Spinner with list view
body: <p>I would like to ask,
  I'm working with spinner.
  I've a list view and a spinner.
  in my spinner  I declare "month", "june","july","august","sept","oct","nov","dec"</p>
  
  <p>In the list view, originally, it is empty.
  When I click on "August" , it will show that data of August(august.java) in the list view,
  May I know is there any way to do it?</p>
  
  <p>Because right now , I'm doing via class..
  Meaning, when I onclick Aug, it will open up new intent.
  But I wanted to merge it into one class, so that when I click "August", it will change in the list view and not open up new intent.
  Is there a way to do it?</p>
  
  <p>This is my code</p>
  
  <pre><code>String [] months = {
                  "June",
                  "July",
                  "August",
                  "Septemeber",
                  "November",
                  "December",
  </code></pre>
  
  <p>part of my date.java</p>
  
  <pre><code>//SpinnerView
              s1 = (Spinner) findViewById(R.id.spinner1);
  
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, months);
          s1.setAdapter(adapter);
          s1.setOnItemSelectedListener(new OnItemSelectedListener()
          {
              public void onItemSelected(AdapterView&lt;?&gt; arg0,View arg1, int arg2, long arg3) {
                  int index = s1.getSelectedItemPosition();
                  //Toast.makeText(getBaseContext(), "You have seleted item :" + months[index] , Toast.LENGTH_SHORT).show();
              }
              public void onNothingSelected(AdapterView&lt;?&gt;arg0) {}
              });
  
  
      if ( s1.equals("August")) {
  
          startActivity(new Intent(date.this,MainActivity.class));
      }
      else{
          startActivity(new Intent(date.this,august
                  .class));
  
      } 
  </code></pre>
  
  <p>data code that I'm getting.
  august.java</p>
  
  <pre><code>public class august extends ListActivity {
  
      String URL = "http://api.eventful.com/rest/events/search?app_key=42t54cX7RbrDFczc&amp;location=singapore&amp;page_size=20&amp;date=august";
  
      // XML node keys
      static final String KEY_EVENT = "event"; // parent node
      static final String KEY_TITLE = "title";
      static final String KEY_URL = "url";
      static final String KEY_DESC = "description";
      static final String KEY_START_TIME = "start_time";
      static final String KEY_STOP_TIME = "stop_time";
      static final String KEY_TIME = "combine_time";
      static final String KEY_VENUE_NAME = "venue_name";
      static final String KEY_COUNTRY_NAME = "country_name";
      static final String KEY_VENUE_ADDRESS = "venue_address";
      static final String KEY_VENUE = "venue";
      static final String KEY_LATITUDE = "latitude";
      static final String KEY_LONGITUDE = "longitude";
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.date);
  
          final ArrayList&lt;HashMap&lt;String, String&gt;&gt; menuItems = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
          XMLParser parser = new XMLParser();
          String xml = parser.getXmlFromUrl(URL); // getting XML
          Document doc = parser.getDomElement(xml); // getting DOM element
  
          NodeList nl = doc.getElementsByTagName(KEY_EVENT);
          // looping through all item nodes &lt;item&gt;
          for (int i = 0; i &lt; nl.getLength(); i++) {
              // creating new HashMap
              HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
              Element e = (Element) nl.item(i);
              // adding each child node to HashMap key =&gt; value
              map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
              map.put(KEY_URL, parser.getValue(e, KEY_URL));
  
              map.put(KEY_DESC, "Description: " + parser.getValue(e, KEY_DESC));
              map.put(KEY_START_TIME, parser.getValue(e, KEY_START_TIME));
              map.put(KEY_STOP_TIME, parser.getValue(e, KEY_STOP_TIME));
              if (parser.getValue(e, KEY_STOP_TIME) != "") {
                  map.put(KEY_TIME, parser.getValue(e, KEY_START_TIME) + "-"
                          + parser.getValue(e, KEY_STOP_TIME));
              } else {
                  map.put(KEY_TIME, parser.getValue(e, KEY_START_TIME));
              }
              map.put(KEY_VENUE_NAME, parser.getValue(e, KEY_VENUE_NAME));
              map.put(KEY_COUNTRY_NAME, parser.getValue(e, KEY_COUNTRY_NAME));
              map.put(KEY_VENUE_ADDRESS, parser.getValue(e, KEY_VENUE_ADDRESS));
              map.put(KEY_LATITUDE, parser.getValue(e, KEY_LATITUDE));
              map.put(KEY_LONGITUDE, parser.getValue(e, KEY_LONGITUDE));
              map.put(KEY_VENUE, parser.getValue(e, KEY_VENUE_NAME) + ", "
                      + parser.getValue(e, KEY_VENUE_ADDRESS));
  
              // adding HashList to ArrayList
  
              menuItems.add(map);
  
          }
  
          // Adding menuItems to ListView
  
          ListAdapter adapter = new SimpleAdapter(this, menuItems,
                  R.layout.list_item, new String[] { KEY_TITLE, KEY_DESC,
                          KEY_COUNTRY_NAME, KEY_VENUE, KEY_LATITUDE,
                          KEY_LONGITUDE, KEY_TIME, }, new int[] { R.id.title,
                          R.id.description, R.id.countryName, R.id.venueName,
                          R.id.lat, R.id.lng, R.id.startTime });
  
          setListAdapter(adapter);
  
          // selecting single ListView item
          ListView lv = getListView();
  
          lv.setOnItemClickListener(new OnItemClickListener() {
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                      int position, long id) {
                  // getting values from selected ListItem
                  String title = ((TextView) view.findViewById(R.id.title))
                          .getText().toString();
                  String description = ((TextView) view
                          .findViewById(R.id.description)).getText().toString();
  
                  String venue = ((TextView) view.findViewById(R.id.venueName))
                          .getText().toString();
                  String lat = ((TextView) view.findViewById(R.id.lat)).getText()
                          .toString();
  
                  String lng = ((TextView) view.findViewById(R.id.lng)).getText()
                          .toString();
  
                  // Starting new intent
                  Intent in = new Intent(getApplicationContext(),
                          SingleMenuItemActivity.class);
                  in.putExtra(KEY_TITLE, title);
                  in.putExtra(KEY_DESC, description);
                  in.putExtra(KEY_VENUE, venue);
                  in.putExtra(KEY_LATITUDE, lat);
                  in.putExtra(KEY_LONGITUDE, lng);
                  startActivity(in);
  
              }
          });
  
  
      }
  
  }
  </code></pre>