In my app I have a custom AlertDialog (handled by the system using showDialog()) which contains a tabhost with 2 tabs. In one of the tabs is a spinner. I can rotate my scr
Ok, I think I've found your problem: dialog.dismiss();
You are doing really strange thing - you are creating dialog through activity but say dismiss to it not to activity to dismiss it - those are two different approaches which you can't mix. You should choose one method: dialog.show and dialog.dismiss or activity.showDialog() and activity.dismissDialog() <- this is better because handles orientation change.
What you should do is just remove dialog from class variables, use activity.showDialog everywhere. Probably your problem was in dismissing dialog in onClick. Just use YourActivityName.this.dismissDialog(DIALOG_NUMBER) and it should work.
Read more about dialogs form developers site - I had also such problems and taken long time to learn how it works but after all - dialogs are not so complicated ;)