1. 表象 Service中能够正常显示Toast,IntentService中不能正常显示Toast.在2.3系统上,不显示toast,在4.3系统上,toast显示.可是不会消失. 2. 问题分析 查阅Android官方文档能够发现: Public Constructors public Toast (Context context) Since: API Level 1 Construct an empty Toast object. You must call setView(View)…
在子线程中使用Toast的时候,出现Force close. 错误提示:Can't create handler inside thread that has not called Looper.prepare() 解决方法: Looper.prepare(); Toast.makeText(ActivityTestActivity.this, "toast", 1).show(); Looper.loop(); 原因: 子线程只是一个普通的线程,其ThreadLoacl中没有设置过L…