title: Android java.lang.IllegalStateException on ListView
body: <p>I use <code>ListActivity</code> with <code>SpecialAdapter</code> that show some log information.
  I do not use background thread but I get an error when scroll list:</p>
  
  <pre><code>java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(16908298, class android.widget.ListView) with Adapter(class ru.FoxGSM.ui.DebugActivity$SpecialAdapter)] 
  </code></pre>
  
  <p>Please, help me.</p>
  
  <p>(<code>FoxLog</code> is static class that get log information, perhaps from another thread. But in list a want show <code>FoxLog</code> snapshot)</p>
  
  <pre><code>public class DebugActivity extends ListActivity {
  
  private class SpecialAdapter extends BaseAdapter    {
      private LayoutInflater mInflater;
  
      public SpecialAdapter(Context context)  { 
          super();
          // Cache the LayoutInflate to avoid asking for a new one each time.
          mInflater = LayoutInflater.from(context);
      }
  
      public int getCount()   {
          return  FoxLog.count();
      }
  
      public long getItemId(int index)    {
          return index;
      }
  
      public Object getItem(int index)    {
          return  FoxLog.get(FoxLog.count()-index-1);
      }
  
      // Get the type of View
      public View getView(int position, View convertView, ViewGroup parent)   {
          TextView text;
  
          if (convertView == null)    {
              convertView = mInflater.inflate(R.layout.debug_list, null);
              text = (TextView)convertView.findViewById(R.id.text);
              convertView.setTag(text);
          }   else
              text = (TextView) convertView.getTag();
  
          String s = (String) getItem(position);
          if (s==null)
              return convertView; 
  
          text.setText(s);
  
          boolean isError = false;
          if (s!=null &amp;&amp; s.length()&gt;0)    {
              String prefix = s.substring(0, 1);
              if (prefix.equals("E") || prefix.equals("W"))
                  isError = true;
          }
          if (isError)
              text.setBackgroundResource(R.color.red);
          else
              text.setBackgroundDrawable(null);
          return convertView;    
  
      }
  }
  
  private void RefreshData()  {
      FoxLog.ReInit(this);        
      SpecialAdapter adapter = (SpecialAdapter)this.getListAdapter();
      adapter.notifyDataSetChanged();
  }
  
  @Override
  public void onCreate(Bundle savedInstanceState) {           
      super.onCreate(savedInstanceState);
      setContentView(R.layout.debug);
  
      FoxLog.ReInit(this);        
      SpecialAdapter adapter = new SpecialAdapter(this);                
      setListAdapter(adapter);        
  
      Button mExit = (Button)findViewById(R.id.exit);
      mExit.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              finish();
          }          
      });
  
    }
  
  }
  </code></pre>