https://kotlinlang.org logo
a

Alexander Repin

11/18/2019, 10:26 AM
Is there're a way to make it working?
a

aiidziis

11/18/2019, 10:28 AM
Copy code
class MainActivity {
    //CODE
}

@Composable
fun Greeting() {
    //CODE
}

@Preview
@Composable
fun Preview() {
    //CODE
}
l

Luca Nicoletti

11/18/2019, 10:29 AM
It tells you what to do
The function must be a top-level function
👆🏻 1
a

Alexander Repin

11/18/2019, 10:30 AM
yeap. it must be top level
but it's already top level, isn't it?
l

Luca Nicoletti

11/18/2019, 10:30 AM
No, it’s inside the
MainActivity
class
a

Alexander Repin

11/18/2019, 10:31 AM
OMG. Okay
l

Luca Nicoletti

11/18/2019, 10:31 AM
🤦🏼
😂 2