title: Looper.prepare() exception in custom adapter
body: <p>I got the exception in doInBackground method of Asynctask. I am using custom adapter and perform filtering i want to perform this filtering in Asycntask the code is running perfect without Asynctask but it take 3 to 4 seconds to perform filtering. That's why i want to use the Asynctask.
  Here is my code...</p>
  
  <pre><code>public FarmerAdapter(Context context, int textViewResourceId,
          List&lt;Farmer&gt; objects) {
      super(context, textViewResourceId, objects);
  
      this.items = (ArrayList&lt;Farmer&gt;) objects;
      this.itemsAll = (ArrayList&lt;Farmer&gt;) items.clone();
      this.suggestions = new ArrayList&lt;Farmer&gt;();
      this.CurrentContext = context;
  
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      if ((this.items == null) || (position + 1 &gt; this.items.size()))
          return convertView;
  
      this.CurrentItem = ((Farmer) this.items.get(position));
  
      LayoutInflater vi = (LayoutInflater) CurrentContext
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      convertView = vi.inflate(R.layout.farmer_list_adapter, null);
  
      TextView name = (TextView) convertView
              .findViewById(R.id.farmer_list_name);
      TextView fname = (TextView) convertView
              .findViewById(R.id.farmer_list_fname);
      TextView cnic = (TextView) convertView
              .findViewById(R.id.farmer_list_cnic);
  
      name.setText(this.CurrentItem.getFarmerName());
      fname.setText(this.CurrentItem.getFarmerFatherName());
      cnic.setText("" + this.CurrentItem.getFarmerCNIC());
  
      return convertView;
  }
  
  public Filter getFilter() {
  
      backgroundTask = new AsyncTask&lt;Void, Void, Void&gt;() {
  
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
              Log.e("AsynTask", " Started");
          }
  
          @Override
          protected Void doInBackground(Void... params) {
              nameFilter = new Filter() {
  
                  public String convertResultToString(Object resultValue) {
                      String str = ((Farmer) (resultValue)).getFarmerName();
                      return str;
                  }
  
                  @Override
                  protected void publishResults(CharSequence constraint,
                          FilterResults results) {
  
                      ArrayList&lt;Farmer&gt; filteredList = (ArrayList&lt;Farmer&gt;) results.values;
                      ArrayList&lt;Farmer&gt; farmerList = new ArrayList&lt;Farmer&gt;();
                      if (results != null &amp;&amp; results.count &gt; 0) {
                          clear();
                          for (Farmer f : filteredList) {
                              farmerList.add(f);
                          }
                          Iterator&lt;Farmer&gt; customerIterator = farmerList.iterator();
                          while (customerIterator.hasNext()) {
                              Farmer fiterator = customerIterator.next();
                              add(fiterator);
                          }
                          notifyDataSetChanged();
                      }
                  }
  
                  @Override
                  protected FilterResults performFiltering(CharSequence constraint) {
  
                      if (constraint != null) {
                          suggestions.clear();
                          for (Farmer farmer : itemsAll) {
                              if (farmer.getFarmerName().toLowerCase()
                                      .startsWith(constraint.toString().toLowerCase())) {
                                  suggestions.add(farmer);
                              }
                          }
                          FilterResults filterResults = new FilterResults();
                          filterResults.values = suggestions;
                          filterResults.count = suggestions.size();
                          return filterResults;
                      } else {
                          return new FilterResults();
                      }
                  }
  
              };
  
  
              return null;
          }
  
          @Override
          protected void onPostExecute(Void result) {
              super.onPostExecute(result);
              Log.e("AsynTask", " Ended");
          }
  
      }.execute();
  
      return nameFilter;
  };
  </code></pre>
  
  <p>Please help me regarding this issue.</p>