I am getting window leak error at runtime because of using an AlertDialog.
I have pointed out the error line in the code below:
Stacktrace:<
You can also get a WindowLeaked exception if you're not in the UI thread when attempting to show the dialog. Easy fix:
this.runOnUiThread(new Runnable() { @Override public void run() { // show dialog here } });