As title says:
I´d like to change the text inside an editText with a button click.
I can do it with TextViews by using this code:
TextView.text= "new text here"
but it doesnt work for EditText
I already tried something like this:
editText.setText("new text here")
Can some one please tell me the equivalent code for editTexts?
this is my code so far:
dialog.setOnClickListener {
var builder = AlertDialog.Builder(this)
var inflater: LayoutInflater = layoutInflater
var view : View = inflater.inflate(R.layout.dialog,null)
builder.setView(view)
builder.setTitle("categories")
builder.setPositiveButton("Ver", { dialogInterface: DialogInterface, i: Int ->
mainscreen.visibility = View.GONE
ListView.visibility = View.VISIBLE
listdogs.visibility=View.VISIBLE
listdogs.adapter = adapterdogs
editText?.setText("husky")
})
Regards