I am trying to optimize old code. And I am trying to replace findviewbyid with viewbinding. But how do I return viewbinding id instead of findviewbyid?
private TextView getTextView(int id){
return (TextView) findViewById(id);
}
This is the old code. But I want to apply viewbinding. I want it to work something like this. As I have no idea how to do it.
private TextView getTextView(int id){
return sampleViewBinding(id);
}
How can I achieve this?