Professional Documents
Culture Documents
Busaing
Donita Rose Alvarado
BSIT 603
03 Hands on Activity 1
CODE:
class MainActivity(App):
def build(self):
layout = BoxLayout(orientation='vertical')
layout.add_widget(self.label)
self.button.bind(on_release=self.show_toast)
layout.add_widget(self.button)
return layout
def on_start(self):
self.show_toast("onStart()")
def on_resume(self):
self.show_toast("onResume()")
def on_pause(self):
self.show_toast("onPause()")
return True
def on_stop(self):
self.show_toast("onStop()")
def on_destroy(self):
self.show_toast("onDestroy()")
def on_restart(self):
self.show_toast("onRestart()")
# You can replace print statement with Toast message for Android
if __name__ == '__main__':
MainActivity().run()