# Is "this" accessible in SAMs?

**URL:** <https://discuss.kotlinlang.org/t/is-this-accessible-in-sams/1477>\
**Category:** Language Design\
**Created:** [February 16, 2016, 11:22pm UTC](https://discuss.kotlinlang.org/t/is-this-accessible-in-sams/1477 "2016-02-16T23:22:04Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![dalewking](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/dalewking/32/1496_2.png) [@dalewking](https://discuss.kotlinlang.org/u/dalewking)\
**Post date:** [February 17, 2016, 6:35pm UTC](https://discuss.kotlinlang.org/t/is-this-accessible-in-sams/1477/5 "2016-02-17T18:35:57Z")

</div>

By the way, while “this” does not work in a SAM, it does work in your original code:

```
val handler = Handler()
val runnableCode = object : Runnable {
    override fun run() {
        // do something
        handler.postDelayed(this, 2000)
    }
}
handler.post(runnableCode)

```

---

_[View the full topic](https://discuss.kotlinlang.org/t/is-this-accessible-in-sams/1477)._
