check activity state before show dialog