title: Why can't I update the AutoCompleteTextView dynamically?
body: <p>I use an ArrayList and an ArrayAdapter to log down the contents of AutoCompleteTextView, and I want to dynamically refresh the AutoCompleteTextView when the list is modified. The modification of the list is triggered in a webviewClient.</p>
  
  <p>However, my code doesn't work. The AutoCompleteTextView can only be updated when the whole activity is reloaded. There is no dynamic update at all. Could anyone help me to find out what was wrong?</p>
  
  <pre><code>    final ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, mHistory); //mHistory is the list of data
      adapter.setNotifyOnChange(true);
      mEditText1.setAdapter(adapter); //mEditText1 is the AutoCompleteTextView
  
      mWebView1.setWebViewClient(new WebViewClient() {
  
          public void onPageFinished(WebView view, String url){
              super.onPageFinished(view, url);
  
              if (!mHistory.contains(mWebView1.getUrl())){
                  mHistory.add(mWebView1.getUrl());
                  writeList(view.getContext(), mHistory, "history");  //this is to store the list elsewhere
              }
              adapter.notifyDataSetChanged();
  
          }
  
      });         
  </code></pre>