下面是我的代码, 
public class MainActivity extends Activity { private ArrayList<String> devices;
private ArrayAdapter<String> devicesAdapter;
private ListView dlna;
private Handler msgHandler;

protected static final int msg_device_add = 0;
protected static final int msg_device_remove = 1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        devices = new ArrayList<String>();
        devicesAdapter = new ArrayAdapter<String>(this, 
         android.R.layout.simple_expandable_list_item_1, devices);
        dlna = new ListView(this);
        dlna.setAdapter(devicesAdapter);
        this.setContentView(dlna);
        
     msgHandler = new Handler() {  //这里老是提示必须为static, 可是我改为static, devicesAdapter就会报错。
请问怎么在子线程里来刷新这个listview
         public void handleMessage(Message msg) {
         switch(msg.what) {
         case msg_device_add:
         case msg_device_remove:
         devicesAdapter.notifyDataSetChanged();
         break;
         }
        
         super.handleMessage(msg);
         }
        };
    }