Skip to content
Advertisement

View binding with include layout not working

I want to use view binding to bind the view in include layout. I had given the included layout with an id ‘topBar’ but still failed to access the views inside of it. And I try to use Android studio auto-fix to create a local variable to see its type. It shows type “android.widget . a” I am using Android Studio4.0. Is this a bug in Android Studio?

My Activity

JavaScript

activity_wallet.xml

JavaScript

view_title.xml

JavaScript

Is this a bug for android studio or something?

Advertisement

Answer

I do nothing on it and it just works automatically. I surely did clean, rebuild, restart Android studio… something at that time but not working. Maybe link another layout in another class would trigger something just fix it under the hood cause I set aside this problem and keep going.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement