Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created July 11, 2017 05:42
Show Gist options
  • Save codenameone/9d1594b3d54a1e6258fdd28fb7b6ddd1 to your computer and use it in GitHub Desktop.
Save codenameone/9d1594b3d54a1e6258fdd28fb7b6ddd1 to your computer and use it in GitHub Desktop.
Kotlin Article Sample
public class MyApplication {
private Form current;
private Resources theme;
public void init(Object context) {
theme = UIManager.initFirstTheme("/theme");
Toolbar.setGlobalToolbar(true);
Log.bindCrashProtection(true);
}
public void start() {
if(current != null){
current.show();
return;
}
Form hi = new Form("Hi World", BoxLayout.y());
hi.add(new Label("Hi World"));
hi.show();
}
public void stop() {
current = getCurrentForm();
if(current instanceof Dialog) {
((Dialog)current).dispose();
current = getCurrentForm();
}
}
public void destroy() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment