I had dialog showing function:
void showDialog(){
new AlertDialog.Builder(MyActivity.this)
...
.show();
}
I was getting this error and i just had to check isFinishing()
before calling this dialog showing function.
if(!isFinishing())
showDialog();