Skip to content

Instantly share code, notes, and snippets.

@sgalles
Created November 13, 2013 22:34
Show Gist options
  • Save sgalles/7457741 to your computer and use it in GitHub Desktop.
Save sgalles/7457741 to your computer and use it in GitHub Desktop.
Nothing more that a proof of concept, this is a basic Android activity written in Ceylon (uses the new syntax for Java interop static inner class/fields of Ceylon 1.0.0). Works with and Android SDK 19.
import android.app { Activity }
import android.os { Bundle }
import android.view { Menu }
import android.widget { TextView }
import java.lang { JString=String }
shared class Foo() extends Activity() {
shared actual void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.\Ilayout.activity_main);
assert (is TextView textView = findViewById(R.\Iid.foo));
textView.text = JString("Hello World !");
}
shared actual Boolean onCreateOptionsMenu(Menu menu) {
menuInflater.inflate(R.\Imenu.main, menu);
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment