title: Android Search Bar--Results appending
body: <p>I have a search option in my Android application which uses a webservice (when searched for a keyword in a Search Bar) and displays the results on my screen.Immediately, next time, when I search for a different keyword, the result is appended to the first result and displayed.What I want is, to erase/clear the first result and then display the second result and not to Append to the first.Please help as am newbie to Android.</p>
  
  <pre><code>public class Srch_Widget extends ListActivity {
  
  ListView lv;
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.mysearchscreen);
  
  //In the search box, i will be typing an alphabet and click on "GO button"
  
  goButton.setOnClickListener(new View.OnClickListener() {
  
  public void onClick(View v) {
  
  //I'm using webservices to retrieve data(JSON String) and will get "EmpName", "EmpID",
  "Salary" and the data will be in a single list called "searchlist" that I used below in
  ser_listadapter.(if you want I can paste the entire webservices)
  
  ser_listadapter();
  
  }
  
  });
  }
  
  public void ser_listadapter() {
  ListAdapter adapter = new SimpleAdapter(this,searchlist,
              R.layout.searchmain, new String[] { "EmpName", "EmpID",
                      "Salary" }, new int[] {
                      R.id.eid, R.id.ename, R.id.sal});
  
  //"searchmain" layout contains 3 textviews with id's: eid,ename,sal
  
  setListAdapter(adapter);
  lv = getListView();
  lv.setTextFilterEnabled(true);
  }
  }
  </code></pre>