Issue
I created a TextView inside activity_main.xml and specified an ID for it, but when I go into MainActivity and click on that ID, it does not recognize TextView, and what does the red line under everything look like? How should I solve this problem?
Solution
The mainActivity does not know where the txt_test is coming from so you have to give it the reference. I would recommend either use ViewBinding or use the old:
val txt = findViewById(R.id.the_id_of_your_textView)
Answered By - Jorge Gutiérrez
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.