code: def for_action(cls, action, callback, single_shot=True):
          
          receiver = cls()
          activity = receiver.__app__.widget
          receiver.setReceiver(receiver.getId())
  
          def on_receive(ctx, intent):
              callback(intent)
  
          receiver.onReceive.connect(on_receive)
          activity.registerReceiver(receiver, IntentFilter(action))
          return receiver
docs: Create a BroadcastReceiver that is invoked when the given 
          action is received.
          
          Parameters
          ----------
          action: String
              Action to receive
          callback: Callable
              Callback to invoke when the action is received
          single_shot: Bool
              Cleanup after one callback
  
          Returns
          -------
              receiver: BroadcastReceiver
                  The receiver that was created. You must hold on to this
                  or the GC will clean it up.