title: Clear listview content?
body: <p>I have a little problem with <code>ListView</code>. How do I clear a <code>ListView</code> content, knowing that it has a custom adapter?</p>
  
  <p><code>edit</code> -
  the custom adapter class extends <code>BaseAdapter</code>, it looks like this:</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.BaseAdapter;
  import android.widget.TextView;
  
  public class MyAdapter extends BaseAdapter {
  
      private Activity activity;
      private String[] data;
      private static LayoutInflater inflater = null;
  
      public MyAdapter(Activity a, String[] str) {
          activity = a;
          data = str;
          inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      }
  
      public static class ViewHolder {
          public TextView text;
      }
  
      @Override
      public int getCount() {
          return data.length;
      }
  
      @Override
      public Object getItem(int position) {
          return position;
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View view, ViewGroup parent) {
          View v = view;
          ViewHolder holder;
          if (v == null) {
              v = inflater.inflate(R.layout.rowa, null);
              holder = new ViewHolder();
              holder.text= v.findViewById(R.id.dexter);
              v.setTag(holder);
          } else {
              holder = v.getTag();
          }
  
          holder.text.setText(data[position]);
  
          return v;
      }
  
  }
  </code></pre>