I decoupled view from my Activity and I have a separate class for all UI related operations. One operation I want to implement there is to inflate menu for Action Bar. I try doing things like these, but none of it works.

```
fun displayMenu() {

    rootView.toolbar.inflateMenu(R.menu.my_menu)

    rootView.toolbar.setOnMenuItemClickListener { item ->
        if (item.itemId == R.id.action_one) {
            listener.onActionOne()
        }

        true
    }
}

```

I tried this:

```
activity.menuInflater.inflate(R.menu.my_menu, rootView.toolbar.menu)

```

and this:

```
rootView.toolbar.inflateMenu(R.menu.my_menu)

```

But none of these gets the job done. How can I inflate this menu?