I'm getting the error message "android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application.
Yes, I know this error is all over stackoverflow and it's based on not getting the context of the activity... however, I am pulling that context and still receiving the error.
From MainActivity:
new MemberStream(this).execute();
From MemberStream: >
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;
}
When I run the application, I get the preceding error on
dialog = new ProgressDialog(a.getApplicationContext());
Any ideas?