CODE

```
private TextWatcher quickSearchTextWatcher = new TextWatcher() {
  @Override
  public void onTextChanged(CharSequence s, int start, int before,
   int count) {

  }

  @Override
  public void beforeTextChanged(CharSequence s, int start, int count,
    int after) {

  }

  @Override
  public void afterTextChanged(Editable s) {
   try {
    filter();
   } catch (Exception e) {

   }
  }
 };

private void filter() {
  String str = activitySecondBrandTextQuickSearch.getText().toString()
    .trim();

  if (str.length() > 2) {
   return;
  }

  try {
   ArrayList<Brand> companyArrayList = new ArrayList<Brand>();

   for (Brand c : ApplicationConstants.brandArrayList) {
    if (c.getName().toLowerCase().startsWith(str)) {
     companyArrayList.add(c);
    }
   }

   companyAdapter = null;
   brandListView.setAdapter(null);

   Collections.sort(companyArrayList, Brand.NAME_ORDER);
   companyAdapter = new BrandAdapter(SecondScreenBrandsActivity.this,
     companyArrayList);
   brandListView.setAdapter(companyAdapter);
   brandListView.setTextFilterEnabled(true);
  } catch (IllegalStateException ise) {
   companyAdapter = null;
   brandListView.setAdapter(null);
  } catch (Exception e) {
   Log.e(TAG, "TextWatcher->" + e.getMessage());
  }
 }

```

ERROR

```
java.lang.IllegalStateException: You cannot call onTextChanged with a non filterable adapter
at android.widget.AbsListView.onTextChanged(AbsListView.java:3625)
android.widget.TextView.sendOnTextChanged(TextView.java:6131)
android.widget.TextView.handleTextChanged(TextView.java:6172)
android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:6316)
android.text.SpannableStringBuilder.sendTextChange(SpannableStringBuilder.java:889)
android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:352)
android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:269)
android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:432)
android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:409)
android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:28)
android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:583)
android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:174)
com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:120)
android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:75)
com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:247)
com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:73)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:123)
android.app.ActivityThread.main(ActivityThread.java:4627)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:521)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
dalvik.system.NativeStart.main(Native Method)

```

The problem here is that the error message is not showing exception occured or line no etc. I need some help as i can not find where the problem is. The app is crashing whenever i am trying to write something more than 3 characters. Any thoughts?