I don't understand why it isn't just as simple as this...
// Add field
val LineLayoutInfo = findViewById<View>(R.id.LineLayoutInfo) as LinearLayout
val Add_Field = findViewById<View>(R.id.buttonAddField) as Button
Add_Field.setOnClickListener{
val tv1 = TextView(this@MainActivity)
tv1.text = "Show Up"
val t = TextView(applicationContext)
LineLayoutInfo.addView(tv1)
}
All I want to do is create a new TextView inside my current LinearLayout. This part of the code is written in Kotlin and stored in the OnCreate(). Is it maybe because I need to refresh the activity?
The output I get when I push the button, looks like this.
D/HwAppInnerBoostImpl: asyncReportData com.xxx.httpposter,2,1,1,0 interval=83
I/ViewRootImpl: jank_removeInvalidNode all the node in jank list is out of time
V/AudioManager: playSoundEffect effectType: 0
V/AudioManager: querySoundEffectsEnabled...
D/HwAppInnerBoostImpl: asyncReportData com.xxx.httpposter,2,1,2,0 interval=353