<https://kotlinlang.org/docs/tutorials/android-plu...
# android
l
https://kotlinlang.org/docs/tutorials/android-plugin.html i am trying view binding in a fragment and it doesnt seem to work the way it does for an activity
a
Is it crashing? And if so, are you calling it in on create view vs on view created? Fragments in general adhere to a different lifecycle, so you'll need to make sure you use the views when they are available
l
ya im calling it in onviewcreated
when i try to resolve the view
instead of import the synthetic android extension it attempts to import the
package.R.id.resourceName
import
where package is my package name
a
Try building the app? Sometimes if there are changes you need to build for the synthetic mappings to be generated