編集:問題は解決しました。グローバルにします。私は今、フェイスパームをやっています。ありがとう!
以下は、AsyncTaskを拡張するクラスからのスニペットです。preExecute()メソッドでprogressDialogを開始し、progressDialog.dismiss();を実行したい。postExecute()メソッドで。私が見つけたすべての例は、以下のようにそれを行うと言っています。私が抱えている問題は、ダイアログがonPostExecuteのスコープ外にあることです。これは予想されますが、すべての例でこのようになっているようです。また、インポート時に、インポートが使用されていないことを示す小さな警告サインがあることに気付きました。このProgressDialogは機能する必要がありますか?私はそれを回す必要がありますか?
import android.app.ProgressDialog;
...
protected void onPostExecute(Bitmap image){//error when doing this in resetDisplay.... onPostExecute is invoked by the ui thread so this may be why it works here and not in resetDisplay
ImageView imageView=(ImageView) parent.findViewById(R.id.imageDisplay);
imageView.setImageBitmap(image);
dialog.dismiss();
}
protected void onPreExecute(){
ProgressDialog dialog=ProgressDialog.show(parent, "Loading", "Loading the image of the day");
}