进度对话框不适用于自定义列表适配器
使用 listAdapter 列出数据时进度对话框不起作用
我认为这都是关于将活动发送到 myAdapter
final myAdapter adapter = new myAdapter(rss_list_activity.this, liste);
final ProgressDialog dialog = ProgressDialog.show(this, "Title",
"Message", true);
final Handler handler = new Handler() {
public void handleMessage(Message msg) {
dialog.dismiss();
}
};
Thread checkUpdate = new Thread() {
public void run() {
getListFromXml();
lv.setAdapter(adapter);
handler.sendEmptyMessage(0);
}
};
checkUpdate.start();
progress dialog doesnt work while listing data with listAdapter
i think its all about sending activity to myAdapter
final myAdapter adapter = new myAdapter(rss_list_activity.this, liste);
final ProgressDialog dialog = ProgressDialog.show(this, "Title",
"Message", true);
final Handler handler = new Handler() {
public void handleMessage(Message msg) {
dialog.dismiss();
}
};
Thread checkUpdate = new Thread() {
public void run() {
getListFromXml();
lv.setAdapter(adapter);
handler.sendEmptyMessage(0);
}
};
checkUpdate.start();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里有一些关于线程的信息,如果我是你,我会使用 AsyncTask:
http:// /developer.android.com/resources/articles/painless-threading.html
与此类似的东西应该可以工作:
在某处使用此
here's some information on threading, i would use an AsyncTask if I were you:
http://developer.android.com/resources/articles/painless-threading.html
Something similar to this should work:
with this somewhere
使用
dialog.show();
显示对话框。您使用dialog.dismiss(); 直接关闭对话框;
use
dialog.show();
to show dialog. you are directly dismissing the dialog usingdialog.dismiss();