如何显示在Android的进度对话框? [英] How to show progress dialog in Android?
本文介绍了如何显示在Android的进度对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想显示进度对话框就当我点击登录按钮,它需要一定的时间在移动到另一个页面,请您及时发布一些示例code吧。
I want to show progress Dialog on when i click on Login button and it takes time in move to another page .please post some sample code for it.
推荐答案
您最好尝试与的AsyncTask 一>
样品code -
Sample code -
private class YourAsyncTask extends AsyncTask<Void, Void, Void> {
protected Void doInBackground(Void... args) {
// do background work here
return null;
}
protected void onPostExecute(Void result) {
// do UI work here
}
}
使用上述code在你的登录按钮活动。而且,这样做的东西,在 doInBackground
和 onPostExecute
Use the above code in your Login Button Activity. And, do the stuff in doInBackground
and onPostExecute
这篇关于如何显示在Android的进度对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文