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:<
Dismiss the alertDialog in onPause() method. i.e. call alertDialog.dismiss()
Note : WindowLeaked exceptions are occured usually if dialogs are not dismissed before Activity is ended.