https://kotlinlang.org logo
#android
Title
# android
l

lawlorslaw

07/21/2018, 8:25 AM
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

Allan Wang

07/21/2018, 9:12 AM
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

lawlorslaw

07/21/2018, 9:15 AM
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

Allan Wang

07/21/2018, 6:48 PM
Try building the app? Sometimes if there are changes you need to build for the synthetic mappings to be generated