Progressdialog慢于Android的展现 [英] Progressdialog slow to show in Android

查看:265
本文介绍了Progressdialog慢于Android的展现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我敢肯定,这是一个简单的线程问题,但...

I'm sure this is a simple threading issue but...

我开始使用ProgressDialog:

I'm starting a ProgressDialog using:

ProgressDialog.show(Example.this, " " , " Loading. Please wait ... ", true,true);

然后运行code块下载和解析XML。

Then running a block of code to download and parse XML.

我遇到的问题是,这是下的onClick按钮方法所有正在运行的,并且XML是下载和分析显示该对话框之前。

The problem I'm having is that this is all running under a onClick button method, and that the xml is downloaded and parsed before the dialog is shown.

任何帮助将是很大的AP preciated!

Any help would be greatly appreciated!

推荐答案

这是几乎可以肯定一个线程问题。线程是我们的朋友(即使是讨厌使用)。该教程你发现的是pretty的不错,但我建议你检查出的 AsyncTask的类......它使生活更轻松。有一个关于它一个很好的书面记录这里

This is almost certainly a threading issue. Threads are our friends (even if they are annoying to use). That tutorial you found is pretty nice, but I'd suggest you check out the AsyncTask class... it makes life easier. There's a nice writeup on it here.

这篇关于Progressdialog慢于Android的展现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆