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

Almas Shagdarov

11/08/2019, 2:41 PM
Hi everyone i cant add viewmodel class func execution to @ navigate up button on app bar plz tell how can i do that?
w

Will W

11/09/2019, 10:14 AM
IIRC you would need to override onOptionsItemSelected() in the view for that ID. Use that to find the right ID and call the View model function. By default if it calls super it will just default to jumping back to the parent activity declared in the manifest. But if you're looking to override it, it's probably better to avoid that all together and use custom buttons on the toolbar.
6 Views