Listview Clearing/resetting/finish not working

nzkogu8pus

New Member
I've got an Android application with 2 activitiesFirst (main) activity: Dropdown with available XML filesSecond (list) acitvity: Show results in a ListView / ListadapterThe application works fine, but when I use the Back button on the second activity it finishes the application and clears the ArrayList (tested with System.out) and choose another XML view, the old XML results are shown.So basically it looks like the listview still apears in my memory, how do I clear/reset this??\[code\] XMLParse parser = new XMLParse(); String xml = parser.getXmlFromUrl(URL); // getting XML Document doc = parser.getDomElement(xml); // getting DOM element //SOME CODE// // Adding menuItems to ListView adapter = new SimpleAdapter(this, menuItems, R.layout.list_item, new String[] { bestemming, vertrek, spoor, vertraging }, new int[] { R.id.bestemming, R.id.vertrek, R.id.spoor, R.id.vertraging }); setListAdapter(adapter); final Button button = (Button) findViewById(R.id.back); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { menuItems.clear(); finish(); } });\[/code\]
 
Back
Top