Using hide() could cause a Leaked Window error.
If you choose to use hide() and you exit your application using finish(), this will cause an error message (seen here) about a window being leaked.
So, either dismiss() your dialogs properly before calling finish() or just use dismiss() instead of hide().