Skip to content

Instantly share code, notes, and snippets.

@codenameone
Last active July 11, 2017 05:47
Show Gist options
  • Save codenameone/90078170dcd22b401ab3494a4773af34 to your computer and use it in GitHub Desktop.
Save codenameone/90078170dcd22b401ab3494a4773af34 to your computer and use it in GitHub Desktop.
class MyApplication {
private var current: Form? = null
private var theme: Resources? = null
fun init(context: Any) {
theme = UIManager.initFirstTheme("/theme")
Toolbar.setGlobalToolbar(true)
Log.bindCrashProtection(true)
}
fun start() {
if (current != null) {
current!!.show()
return
}
val hi = Form("Hi World", BoxLayout.y())
hi.add(Label("Hi World"))
hi.show()
}
fun stop() {
current = getCurrentForm()
if (current is Dialog) {
(current as Dialog).dispose()
current = getCurrentForm()
}
}
fun destroy() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment