Android 活动指示器
我正在为 Android 应用程序编程。单击按钮时,它会调用服务来显示必要的内容。调用服务并解析该服务中存在的 XML 数据需要花费近 5 到 10 秒的时间。在这 5 秒的时间段内,我需要显示一个活动指示器,并显示一条文本“正在加载。请稍候...”。这部分对于 iPhone 来说效果很好。但在安卓中则不然。
任何帮助将不胜感激..
谢谢
I am programming for an Android application. while clicking a button, it calls a service to display the necessary contents. For calling the service and to parse the XML data present in that service it takes nearly 5 to 10 seconds. In these 5 seconds time period I need to display an activity Indicator with a text stating that "Loading. Please wait...". This part works fine for iPhone. But not in Android.
Any help would be appreciated..
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查此。请参阅“创建进度对话框”部分。尝试解析 AsyncTask 中的 XML。当您启动任务时,仅显示进度对话框。任务完成后 - 隐藏进度对话框。
Check this. Look at "Creating a ProgressDialog" section. Try to parse the XMLs in AsyncTask. When you start the task just show the progress dialog. When the task finishes - hide the progress dialog.
如果您想在服务运行时显示一条消息,您可以使用进度对话框。
要关闭此进度对话框,请使用
if you want to show a message when your service is running you can use Progress Dialog for that.
to dismiss this progress dialog use