enter image description hereI 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?
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)