在android程序中如果有使用多线程,一定要记住永远不要在你的线程中调用更新UI的代码,包括 Toast.makeText这些都不能调用,如果要调用可以把这些UI的处理要写在Handler里面,否则会报Can't create handler inside thread that has not called Looper.prepar这类的错误,甚至导致你的程序会无故退出。