View binding vs android extension

Hi guys, I want to know if view binding is mandatory because all the lessons I’m on at Udemy use android extensions. When asked, they say keep to synthetics/extensions. There was one course using view binding but when I do recycler view, especially in the onBind method it throws ‘unresolved reference’ errors even after declaring variables in main activity. and the instructor has gone unresponsive. Pls clarify, thanks a lot!

Synthethics is deprecated and will soon be completely removed. View Binding is not mandatory but is highly recommended. Regarding problems with RecyclerView, if you show us your code we can help you more.

1 Like

Thank you so much for your quick reply MikebeMiki, appreciate it. Let me re do the lesson and post the error here. btw, if it’s not mandatory, then do we use findViewById or which method? Thanks again.

You are welcome. Yes, you will need to use findViewById if you don’t use synthetics or viewBinding.

1 Like