Finish android activity from another with Kotlin

后端 未结 2 609
旧巷少年郎
旧巷少年郎 2021-01-21 14:13

I\'m trying to finish an activity from another (android) with kotlin. I know the wat to do it with java is with the following code (https://stackoverflow.com/a/10379275/7280257)

2条回答
  •  情深已故
    2021-01-21 15:14

    The error Expecting member declaration is there because you wrote a statement (the function call) inside a class. In that scope, declarations (functions, inner classes) are expected.

    You have to place your statements inside functions (and then call those from somewhere) in order for them to be executed.

提交回复
热议问题