解决方案 »

  1.   

    用AsyncTask 或Handler postmessage的机制来解决其他线程操作ui控件的问题,
    直接通过一个thread来操作UI控件不报错只是运气建议买本Android开发相关的书籍,比如Pro Android 4
    或者多看看android developer网址的guide及training
    http://developer.android.com/guide/components/processes-and-threads.html
      

  2.   

    因为这里存在线程安全问题,把我发的android developer文档的连接看完,你会了解google的一些设计理念Threads
    ...
    Additionally, the Andoid UI toolkit is not thread-safe. So, you must not manipulate your UI from a worker thread—you must do all manipulation to your user interface from the UI thread. Thus, there are simply two rules to Android's single thread model:1. Do not block the UI thread
    2. Do not access the Android UI toolkit from outside the UI thread
      

  3.   

    已找到答案
    http://blog.csdn.net/zhaokaiqiang1992/article/details/43410351