Skip to content

Instantly share code, notes, and snippets.

@manijshrestha
Created September 3, 2014 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manijshrestha/a084447d11fd3b84b700 to your computer and use it in GitHub Desktop.
Save manijshrestha/a084447d11fd3b84b700 to your computer and use it in GitHub Desktop.
Groovy-Android-DroidActivity
package com.manijshrestha.groovydroidexample
import android.app.Activity
import android.os.Bundle
import android.widget.TextView
import groovy.transform.CompileStatic
@CompileStatic
public class DroidActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_droid);
String messageText = "Hello Groovy!";
def message = findViewById(R.id.message) as TextView
message.text = messageText;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment