check for available Activity before trying to create a dialog