def onReceive(context, reload_intent)
      Log.d "Got reload intent: #{reload_intent.inspect}"
      file_string = reload_intent.get_string_extra('reload')
      if file_string
        scripts_dir = @activity.getExternalFilesDir(nil).absolute_path + '/scripts'
        files = file_string.split(/(?<!&);/).map { |f| f.gsub(/&(.)/) { |m| m[1] } }
        with_large_stack(size: 256) do
          files.each do |file|
            Log.d "load file: #{scripts_dir}/#{file}"
            load "#{scripts_dir}/#{file}"
          end
        end
        Log.d 'restart activity'
        if @activity.intent.action == android.content.Intent::ACTION_MAIN ||
            @activity.intent.action == android.hardware.usb.UsbManager::ACTION_USB_DEVICE_ATTACHED
          restart_intent = android.content.Intent.new(@activity.intent).
              setAction(android.content.Intent::ACTION_VIEW)
        else
          restart_intent = @activity.intent
        end
        @activity.finish
        @activity.startActivity(restart_intent)
        Log.d 'activity restarted'
      end
      Log.d 'reload complete.'
      true
    rescue Exception => e
      Log.e "Exception handling reload broadcast: #{e.message}"
      Log.e e.backtrace.join("\n")
    end
def onReceive(context, reload_intent)
      Log.d "Got reload intent: #{reload_intent.inspect}"
      file_string = reload_intent.get_string_extra('reload')
      if file_string
        scripts_dir = @activity.getExternalFilesDir(nil).absolute_path + '/scripts'
        files = file_string.split(/(?<!&);/).map { |f| f.gsub(/&(.)/) { |m| m[1] } }
        with_large_stack(size: 256) do
          files.each do |file|
            Log.d "load file: #{scripts_dir}/#{file}"
            load "#{scripts_dir}/#{file}"
          end
        end
        Log.d 'restart activity'
        if @activity.intent.action == android.content.Intent::ACTION_MAIN ||
            @activity.intent.action == android.hardware.usb.UsbManager::ACTION_USB_DEVICE_ATTACHED
          restart_intent = android.content.Intent.new(@activity.intent).
              setAction(android.content.Intent::ACTION_VIEW)
        else
          restart_intent = @activity.intent
        end
        @activity.finish
        @activity.startActivity(restart_intent)
        Log.d 'activity restarted'
      end
      Log.d 'reload complete.'
      true
    rescue Exception => e
      Log.e "Exception handling reload broadcast: #{e.message}"
      Log.e e.backtrace.join("\n")
    end
FIXME(uwe):  I would like to receive a string array,
              but have not found a way to do that.