我在我的应用程序中编写了Thread
。当线程开始运行时,UI屏幕变为空白。我该如何避免这种情况?Android线程使用户界面空白屏幕
public class SetTickerText extends Thread
{
@Override
public void run()
{
while(true)
{
SystemClock.sleep(25000);
Log.i("Map", "after wait");
}
}
你是如何启动线程的?通过从OnCreate方法调用它,可以调用 – forsvarir 2011-04-11 14:28:24
。 m_SetTickerText.run(); – indira 2011-04-11 14:29:25
你需要调用thread.start,而不是直接运行函数 – forsvarir 2011-04-11 14:33:25