0

I am getting a "android.view.WindowManager$BadTokenException" exception sometimes on launching my application in only android One Micromax device. This doesnot happen in any other device. I have read the question ""android.view.WindowManager$BadTokenException: Unable to add window" on buider.show()" but still it does not explain why is it happening only in one device that too only sometimes. Any idea what is happening??

Thanks in advance.

Community
  • 1
  • 1

1 Answers1

0

i had this problem in showing a Dialog in DatabaseHandler class, the Dialog needs a Context. ProgressDialog pDialog = new ProgressDialog(context);
in activity i was called my Class like this
DBHandler db = new DBHandler(getApplicationContext());
this change solved my problem
DBHandler db = new DBHandler(MainActivity.this);

Amir
  • 1,189
  • 18
  • 22