Last active
November 13, 2020 12:46
-
-
Save thalespupo/7245ccc919e55461e799a393fd3a07d1 to your computer and use it in GitHub Desktop.
MainActivity Kotlin Synthetic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlinx.android.synthetic.main.activity_main.* | |
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
// Já podemos utilizar o txtView | |
// sem necessidade de criar um membro p/ classe | |
// e fazer o findViewById | |
txtView?.text = "vai algum texto aqui" | |
txtView?.setOnClickListener { } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment