Finally, the solution for the problem was to modify the CloseDialogRunnable, here is the working code:
public class CloseDialogRunnable implements Runnable {
/**
* http://stackoverflow.com/questions/5844308/removecallbacks-not-
* stopping-runnable
*/
private boolean killCloseActivityRunnable = false;
public void killRunnable() {
killCloseActivityRunnable = true;
}
@Override
public void run() {
if (killCloseActivityRunnable) {
return;
}
if (getDialog() != null && getDialog().isShowing() && isResumed()) {
try {
dismiss();
} catch (IllegalArgumentException e) {
Log.e(TAG, "Error dismissing");
}
}
}
}