-3

I want to do something like this:

public void setContentView(int resId) {
    this.content = itemView.findViewById(resId);
}

but don't know how. Any solutions to fix my code below?

private var contentView: AppCompatEditText? = null
set(value: Int) {field = v.findViewById(value)} // value in setter is AppCompatEditText? type not Int
Patryk Kubiak
  • 1,679
  • 2
  • 11
  • 17

1 Answers1

-3

Does this not work?

fun setView(resID: Int){
  foo = view.findViewById(resID)
}

Edit: What is the error you are getting?

temp_
  • 1,238
  • 2
  • 12
  • 24