Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android AsyncTask+抽屉布局不工作的进度对话框_Android_Android Asynctask_Progressdialog_Drawerlayout - Fatal编程技术网

Android AsyncTask+抽屉布局不工作的进度对话框

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

我在一个应用程序中工作,我在活动之间有几个网络请求,所有这些请求都在ProgressDialog中显示并正常工作。。。除了第一个。我猜这是因为我实现了一个抽屉布局,这会阻塞对话框

在提出请求之前,我曾尝试过解雇抽屉,但仍然不起作用:

// 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();
    }
我有类似的要求,通过应用程序和所有的作品只是罚款。。。除此之外:

知道我做错了什么吗

谢谢

编辑:所以我选择了抽屉布局,出于某种原因,此对话框仍无法加载: