「android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application.
はい、私はこのエラーがスタックオーバーフロー全体にあり、アクティビティのコンテキストを取得していないことに基づいていることを知っています...ただし、そのコンテキストを取得してもエラーが発生します。
MainActivity から:
new MemberStream(this).execute();
メンバーストリームから: >
public HomeActivity activity;
ProgressDialog dialog;
public MemberStream(HomeActivity a) {
this.activity = a;
dialog = new ProgressDialog(a.getApplicationContext());
}
@Override
protected void onPreExecute() {
this.dialog.setMessage("Loading");
this.dialog.show();
}
@Override
protected Boolean doInBackground(String... params) {
updateMembers(url, 0);
return true;
}
アプリケーションを実行すると、上記のエラーが発生します
ダイアログ = 新しい ProgressDialog(a.getApplicationContext());
何か案は?