Class: AMQScreen

Inherits:
Android::App::Activity
  • Object
show all
Defined in:
lib/android_motion_query/screen.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#amqObject

Returns the value of attribute amq.



2
3
4
# File 'lib/android_motion_query/screen.rb', line 2

def amq
  @amq
end

#extrasObject

Returns the value of attribute extras.



2
3
4
# File 'lib/android_motion_query/screen.rb', line 2

def extras
  @extras
end

Instance Method Details

#create_amq_objectObject



10
11
12
# File 'lib/android_motion_query/screen.rb', line 10

def create_amq_object
  self.amq = AndroidMotionQuery.new(self)
end

#extra(key) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/android_motion_query/screen.rb', line 22

def extra(key)
  data = getIntent.getExtra(key.to_s)
  if data.nil?
    puts "WARNING: The extra data (#{key.to_s}) you are trying to get is nil"
  end
  data
end

#onCreate(savedInstance) ⇒ Object



4
5
6
7
8
# File 'lib/android_motion_query/screen.rb', line 4

def onCreate(savedInstance)
  super
  self.create_amq_object
  self.on_create(savedInstance)
end

#open_screen(screen, extra_data = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/android_motion_query/screen.rb', line 14

def open_screen(screen, extra_data={})
  intent = Android::Content::Intent.new(self, screen)
  extra_data.each do |k, v|
    intent.putExtra(k.to_s, v)
  end
  startActivity(intent)
end