title: AutoCompleteTextView doesn't show suggestions in Android 2.3.5
body: <p>I'm using a special autocompletetextview for suggestions of thousands of streets. Due to this huge element list, I have to clear and populate the Adapter on the fly depending on the first input letter. For example, when the user enters "b", the Adapter is being populated with all streets beginning with "b". This works in all Android versions. Today one user told me that there are problems in Android 2.3.5, Samsung Galaxy Ace.</p>
  
  <p>When he begins to enter letters, there is no dropdown with suggestions.
  When he enters "b", it only suggest streets which consist of two names while the second name begins with "b". For example: the proposals he get for "b" is "Am Bahnhof" or "Alte Bahnstraße". There seems to be a pattern, but I can't explain how this happens and I can't reproduce this, neither in any emulator nor on a real device (moreover there is no 2.3.5 emulator).</p>
  
  <p>Below is the code. Just for information: I have to clear in beforeTextChange, otherwise the application would crash when I delete the input in the field very quickly. Obviously it can't exchage the lists fast enough. And I need the variable alreadyAdded, otherwise it would add the list twice when I delete the input down to the first letter. </p>
  
  <p>What is really strange: I've never changed this part since the first implementation and the user told me it worked at the first version. But suddendly it doesn't work anymore. Is it possible that the compiled code is somehow corrupt? Any ideas?</p>
  
  <p>I would also accept a solution when somebody could tell me how to reproduce this.</p>
  
  <p>Invocation:</p>
  
  <pre><code>autoCompleteTextView.addTextChangedListener(new StreetTextWatcher(adapter));
  </code></pre>
  
  <p>StreetArrayAdapter:</p>
  
  <pre><code>public class StreetArrayAdapter extends ArrayAdapter&lt;String&gt; {
  
      public StreetArrayAdapter(Context context, int textViewResourceId) {
          super(context, textViewResourceId);
      }
  
      public void addAll(String[] streets) {
          for (String street : streets) {
              add(street);
          }
      }
  }
  </code></pre>
  
  <p>StreetTextWatcher:</p>
  
  <pre><code>public class StreetTextWatcher implements TextWatcher {
  
      private final StreetArrayAdapter adapter;
      private boolean alreadyAdded = false;
  
      public StreetTextWatcher(StreetArrayAdapter adapter) {
          this.adapter = adapter;
      }
  
      @Override
      public void afterTextChanged(Editable s) {
          //not used
      }
  
      @Override
      public void beforeTextChanged(CharSequence s, int start, int count, int after) {
          if (s.length() &lt; 1)  {
              adapter.clear();
  
              alreadyAdded = false;
          }
      }
  
      @Override
      public void onTextChanged(CharSequence s, int start, int before, int count) {           
          if (s.length() == 1) {
              populateAdapter(s);
  
              alreadyAdded = true;
          }
      }
  
      private void populateAdapter(CharSequence s) {  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("a") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_A);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("ä") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_A);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("b") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_B);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("c") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_C);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("d") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_D);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("e") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_E);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("f") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_F);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("g") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_G);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("h") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_H);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("i") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_I);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("j") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_J);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("k") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_K);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("l") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_L);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("m") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_M);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("n") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_N);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("o") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_O);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("ö") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_O);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("p") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_P);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("q") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_Q);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("r") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_R);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("s") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_S);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("t") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_T);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("u") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_U);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("ü") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_U);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("v") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_V);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("w") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_W);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("y") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_Y);
          }
  
          if (s.toString().toLowerCase(Locale.GERMAN).startsWith("z") &amp;&amp; !alreadyAdded)  {
              adapter.addAll(StreetNames.STREETS_Z);
          }
      }
  }
  </code></pre>