Sha256: 4b965bc66588b1c831bc9f8194ca374195c11e9bdb61a2fe82cc0e39f17991f0

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 Bytes

Contents

require 'ruboto/broadcast_receiver'

import android.util.Log

RubotoBroadcastReceiver.new_with_callbacks do
  # will get called whenever the BroadcastReceiver receives an intent (whenever onReceive is called)
  def on_receive(context, intent)
    Log.v "SampleBroadcastReceiver", 'Broadcast received!'
    Log.v "SampleBroadcastReceiver", intent.getExtras.to_s
    context.run_on_ui_thread{$activity.title = 'Broadcast received!'}
    Log.v "SampleBroadcastReceiver", 'Broadcast processed OK!'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruboto-0.6.0 assets/samples/sample_broadcast_receiver.rb