Android AsyncTask+抽屉布局不工作的进度对话框
我在一个应用程序中工作,我在活动之间有几个网络请求,所有这些请求都在ProgressDialog中显示并正常工作。。。除了第一个。我猜这是因为我实现了一个抽屉布局,这会阻塞对话框 在提出请求之前,我曾尝试过解雇抽屉,但仍然不起作用:Android AsyncTask+抽屉布局不工作的进度对话框,android,android-asynctask,progressdialog,drawerlayout,Android,Android Asynctask,Progressdialog,Drawerlayout,我在一个应用程序中工作,我在活动之间有几个网络请求,所有这些请求都在ProgressDialog中显示并正常工作。。。除了第一个。我猜这是因为我实现了一个抽屉布局,这会阻塞对话框 在提出请求之前,我曾尝试过解雇抽屉,但仍然不起作用: // This is called when someone clicks in an item from the drawer layout // "this" is passed and fetched as Context for the ProgressDi
// This is called when someone clicks in an item from the drawer layout
// "this" is passed and fetched as Context for the ProgressDialog
amr = new AvailableModelRequest(this,ss,this.getFilesDir(), modelType);
... more stuff goes here to handle the result from the Request.
// Inside the AvailableModelRequest...
loader.execute(MESSAGE_TYPE);
// The AsyncTask that handles the network request and showing the dialog
private class DataLoader extends AsyncTask<String, Void, Boolean> {
ProgressDialog pD = new ProgressDialog(context);
@Override
protected void onPreExecute() {
super.onPreExecute();
Log.i("INSIDE PRE EXECUTE!: ", "HELLO DIALOG!!");
pD.setTitle("Loading");
pD.setMessage("Gathering information...");
pD.setIndeterminate(false);
pD.setCancelable(false);
pD.show();
}
@SuppressWarnings("unused")
@Override
protected Boolean doInBackground(String... message) {
// Network stuff happens
}
/**
* Look for errors in the server operations
*/
@Override
protected void onPostExecute(Boolean success) {
// do stuff based on the success or not
pD.dismiss();
}
我有类似的要求,通过应用程序和所有的作品只是罚款。。。除此之外:
知道我做错了什么吗
谢谢
编辑:所以我选择了抽屉布局,出于某种原因,此对话框仍无法加载: