Last active
November 13, 2020 12:30
-
-
Save thalespupo/9df59237aec7229a64aeb1c2bf007db7 to your computer and use it in GitHub Desktop.
MainActivity findViewById
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
class MainActivity : AppCompatActivity() { | |
private var myTextView: TextView? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
myTextView = findViewById(R.id.txtView) | |
// Agora podemos utilizar o txtView | |
myTextView?.text = "vai algum texto aqui" | |
myTextView?.setOnClickListener { } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment