実行中の非同期タスクがあり、その中で接続されたデバイスから結果を取得します。非同期タスクは、結果を受け取った後に onPostExcute を終了して実行する必要があります。このような返信があるまで待つ流れを実行する方法はありますか? ありがとう
private void getData(){
    final Context con = this.getActivity();
    String tmp;
    AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
        private ProgressDialog pd;
        @Override
        protected void onPreExecute() {
            pd = new ProgressDialog(con);
            pd.setTitle("Scanning...");
            pd.setMessage("Please wait.");
            pd.setCancelable(false);
            pd.setIndeterminate(true);
            pd.show();
        }
        @Override
        protected Void doInBackground(Void... arg0) {
            try {
                tmp = Control.getReply();
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return null;
        }
        @Override
        protected void onPostExecute(Void result) {
            pd.dismiss();
            startTestModeControl(tmp);
        }
    };
    task.execute((Void[])null);
}