Skip to content

Instantly share code, notes, and snippets.

@shem8
Created January 4, 2016 13:57
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 shem8/c3a1b5317fd8a2df84ef to your computer and use it in GitHub Desktop.
Save shem8/c3a1b5317fd8a2df84ef to your computer and use it in GitHub Desktop.
// Using R.layout.activity_main from the main source set
import kotlinx.android.synthetic.main.activity_main.*
public class MyActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
textView.setText("Hello, world!") // Instead of findView(R.id.textView) as TextView
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment