# Unable to use Kotlin android extension in adapter class

**URL:** <https://discuss.kotlinlang.org/t/unable-to-use-kotlin-android-extension-in-adapter-class/2890>\
**Category:** Android\
**Created:** [May 26, 2017, 7:29am UTC](https://discuss.kotlinlang.org/t/unable-to-use-kotlin-android-extension-in-adapter-class/2890 "2017-05-26T07:29:09Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![yanex](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/yanex/32/1489_2.png) [@yanex](https://discuss.kotlinlang.org/u/yanex)\
**Post date:** [July 11, 2017, 8:38pm UTC](https://discuss.kotlinlang.org/t/unable-to-use-kotlin-android-extension-in-adapter-class/2890/3 "2017-07-11T20:38:49Z")

</div>

_Android Extensions_ plugin now generates synthetic properties for `Activity`, `Fragment` and `View` receiver types. I think you can use the base view in your custom components:

```
class MyComponent(val baseView: View) {
    val firstName = baseView.firstName
    val lastName = baseView.lastName
}

```

Note to import the `kotlinx.android.synthetic.<variantName>.<layoutName>.view` package contents.

Also, there is a KEEP for supporting user holder classes, and the prototype is almost done. See [Android Extensions: View holder pattern support and caching options by yanex · Pull Request #33 · Kotlin/KEEP · GitHub](https://github.com/Kotlin/KEEP/pull/33) for more details.

---

_[View the full topic](https://discuss.kotlinlang.org/t/unable-to-use-kotlin-android-extension-in-adapter-class/2890)._
