我有一个带有进度条的 Asynctask。我为进度条创建了自定义布局,但是当进度条出现时屏幕变暗。我怎样才能删除这个?这是我的代码,
活动
final ProgressDialog progDailog = new ProgressDialog(DashboardActivity.this);
class loadComments extends AsyncTask<JSONObject, String, JSONObject> {
@Override
protected void onPreExecute() {
super.onPreExecute();
progDailog.setIndeterminate(false);
progDailog.setCancelable(true);
progDailog.show();
progDailog.setContentView(R.layout.progress_circle);
}
@Override
protected void onProgressUpdate(String... values) {
super.onProgressUpdate(values);
}
protected JSONObject doInBackground(JSONObject... params) {
}
@Override
protected void onPostExecute(JSONObject json2) {
progDailog.dismiss();
}
}
new loadComments().execute();
进度条xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:background="#00000000">
<ProgressBar
android:indeterminateDrawable="@drawable/progress"
android:layout_height="wrap_content" android:layout_width="wrap_content"/>
</LinearLayout>