added isActivityShown function