Sha256: a64ff3b0a441f722424cd3a642d434819fa5d3045060cdd701d0530e4c0acea7

Contents?: true

Size: 843 Bytes

Versions: 16

Compression:

Stored size: 843 Bytes

Contents

require 'ruboto/widget'

ruboto_import_widgets :LinearLayout, :TextView

class StartupExceptionActivity
  def onCreate(bundle)
    super
    setTitle File.basename(__FILE__).chomp('_activity.rb').split('_').
                 map { |s| "#{s[0..0].upcase}#{s[1..-1]}" }.join(' ')

    self.content_view =
        linear_layout :orientation => :vertical, :gravity => :center do
          @text_view = text_view :id => 42, :text => title, :text_size => 48.0,
                                 :gravity => :center
        end
    intent = android.content.Intent.new
    intent.setClassName($package_name, 'com.example.UndeclaredActivity')
    startActivity(intent)
  rescue Exception
    puts "Expected exception creating activity: #{$!}"
    puts $!.backtrace.join("\n")
  end

  def onResume
    super
    @text_view.text = 'Startup OK'
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruboto-1.6.1 test/activity/startup_exception_activity.rb
ruboto-1.6.0 test/activity/startup_exception_activity.rb
ruboto-1.5.0 test/activity/startup_exception_activity.rb
ruboto-1.4.1 test/activity/startup_exception_activity.rb
ruboto-1.4.0 test/activity/startup_exception_activity.rb
ruboto-1.3.1 test/activity/startup_exception_activity.rb
ruboto-1.3.0 test/activity/startup_exception_activity.rb
ruboto-1.2.0 test/activity/startup_exception_activity.rb
ruboto-1.1.2 test/activity/startup_exception_activity.rb
ruboto-1.1.1 test/activity/startup_exception_activity.rb
ruboto-1.1.0 test/activity/startup_exception_activity.rb
ruboto-1.0.3 test/activity/startup_exception_activity.rb
ruboto-1.0.2 test/activity/startup_exception_activity.rb
ruboto-1.0.1 test/activity/startup_exception_activity.rb
ruboto-1.0.0 test/activity/startup_exception_activity.rb
ruboto-0.16.0 test/activity/startup_exception_activity.rb