Implemented activity redirection based on preferences.