android中的无限进度条

android中的无限进度条,android,progressdialog,Android,Progressdialog,我想用android中的大字体对话框设置消息 我正在使用以下代码来完成此操作 progress_dialog=new ProgressDialog(this); progress_dialog.show(About_Us_Activity.this, Html.fromHtml(""), Html.fromHtml("big>Message...</big>"), false); progress\u dialog=新建ProgressDialog(此); progre

我想用android中的大字体对话框设置消息

我正在使用以下代码来完成此操作

 progress_dialog=new ProgressDialog(this);

 progress_dialog.show(About_Us_Activity.this, Html.fromHtml(""), Html.fromHtml("big>Message...</big>"), false);
progress\u dialog=新建ProgressDialog(此);
progress\u dialog.show(About\u Us\u Activity.this,Html.fromHtml(“”),Html.fromHtml(“大>消息…”),false);

我在AsyncTask onPreExecute()方法中使用了上述代码,并在onPostExecute方法中取消了这些代码,问题是我的进度对话框正在无限期运行,这意味着它没有取消。我的代码有什么问题。日志cat中没有显示错误。

1。使用自定义对话框progress.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center_horizontal" >
 <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+android:id/progress_large"
        android:layout_marginBottom="28dp"
        android:layout_marginLeft="21dp"
        android:layout_toRightOf="@+android:id/progress_large"
        android:text="Loading.."
        android:textSize="15dp"
        android:textStyle="bold" />
   <ProgressBar
        android:id="@+android:id/progress_large"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" />
</RelativeLayout>

2.在java文件中调用progress.xml: setContentView(R.layout.progress)


3.在AndroidManifest.xml中,内部标记使用android:theme=“@android:style/theme.Holo.Dialog”

是否在onPostExecute中关闭了该对话框?是否确实调用了onPostExecute?是@Pratek,请阅读整个问题,我已经在问题中提到,我已取消progressdialog。如果是,请确认您的onPostExecute已执行,然后请在onPostExecute中共享您的取消部分,这将有助于跟踪问题。我使用此代码取消onPostExecute上的对话框,如果(progressdialog.isShowing()){progressdialog.Dislose();}