【发布时间】:2012-02-21 02:50:14
【问题描述】:
我很困惑,因为这在其他活动中对我来说效果很好,在这里我基本上只是复制粘贴了代码,但 ProgressDialog 没有出现。代码如下:
public class MyListActivity extends ListActivity {
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.mylayout);
final ProgressDialog progress = new ProgressDialog(this);
progress.setProgressStyle(STYLE_SPINNER);
progress.setIndeterminate(true);
progress.setMessage("Working...");
progress.show();
Thread thread = new Thread()
{
public void run()
{
//long operation populating the listactivity
progress.dismiss();
}
};
thread.run();
}
}
【问题讨论】: