Process activity codes and return a flash message