Android 对话框中的进度条(二)

2014-11-24 03:03:30 · 作者: · 浏览: 9
pDialog.show();

new Thread()
{
public void run()
{
try
{
while (m_count <= 100)
{
// 由线程来控制进度。
m_pDialog.setProgress(m_count++);
Thread.sleep(100);
}
m_pDialog.cancel();
}
catch (InterruptedException e)
{
m_pDialog.cancel();
}
}
}.start();

}
});
}
}