Im trying to dynamically create edittext in Kotlin on button click. The Button click invokes below function. The click will also increment the count value. Getting type exception while attempting it. :
int count = 0
fun addrow() {
val defect: FloatingActionButton = findViewById(id)
val gridLayout: GridLayout = findViewById(gl)
gridLayout.visibility = View.VISIBLE
val eqp = EditText(this)
eqp.hint = "Eqp"
eqp.textSize = 14F
eqp.width = 200
eqp.id = ("R.id"+count).toInt() //Error for this command
}