本文介绍了无进展微调在ProgressDialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想创建一个ProgressDialog因为现在只是Play商店每一个应用程序可见。我现在用的是code:
getActivity()。runOnUiThread(新的Runnable(){
@覆盖
公共无效的run(){
ProgressDialog对话框;
对话框= ProgressDialog.show(getActivity(),称号,消息,真,假);
}
});
我也尝试过只用2线了Runnable内(不创建一个线程)从片段内,无论我做什么我无法看到飞旋在ProgressDialog 。我附上截图,这样就可以明白我的意思。有人请帮助我。
在银河S6,所有的股票OS上运行的Android 5.1.1。
修改:进口商品有:
进口android.app.Fragment;
进口android.app.ProgressDialog;
解决方案
试试这个
ProgressDialog progressDialog =新ProgressDialog(背景);
progressDialog.setMessage([YOUR MESSAGE]);
progressDialog.setCancelable(真); //检查的要求
progressDialog.show();
I am trying to create a ProgressDialog as seen in just about every app on the Play Store now. I am using the code:
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
ProgressDialog dialog;
dialog = ProgressDialog.show(getActivity(), "title", "message", true, false);
}
});
I have also tried with just the 2 lines inside the Runnable (without creating a thread) from inside a fragment and no matter what I do I can't see the spinner in the ProgressDialog. I'm attaching a screenshot so that you can see what I mean. Somebody PLEASE help me.
Running Android 5.1.1 on a Galaxy S6, all stock OS.
EDIT: Imports are:
import android.app.Fragment;
import android.app.ProgressDialog;
解决方案
Try this
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setMessage("[YOUR MESSAGE]");
progressDialog.setCancelable(true); // Check as required
progressDialog.show();
这篇关于无进展微调在ProgressDialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!