Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created July 11, 2017 05:49
Show Gist options
  • Save codenameone/d21e57eb35d25a97705450c32fdee549 to your computer and use it in GitHub Desktop.
Save codenameone/d21e57eb35d25a97705450c32fdee549 to your computer and use it in GitHub Desktop.
open 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