Sha256: 57612e011d7d76fc72dea19a2b272c914928e5187876357988136747d149974a

Contents?: true

Size: 925 Bytes

Versions: 1

Compression:

Stored size: 925 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 => android.view.Gravity::CENTER do
          @text_view = text_view :id => 42, :text => title, :text_size => 48.0, :gravity => android.view.Gravity::CENTER
        end
    intent = android.content.Intent.new
    intent.setClassName($package_name, 'com.example.android.lunarlander.LunarLander')
    startActivity(intent)
  rescue Exception
    puts "************************ Exception creating activity: #{$!}"
    puts $!.backtrace.join("\n")
  end

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

  def onPause
    super
    @text_view.text = 'Paused'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruboto-0.11.0.rc.0 test/activity/startup_exception_activity.rb