Replace of the code of the performItemAction to handle submenu for an ActionProvider (as the original Android source code does)