class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
HappyBirthdayTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
GreetingText(message = "Happy Birthday Sam!")
}
}
}
}
}
URL of codelab
class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { HappyBirthdayTheme { // A surface container using the 'background' color from the theme Surface( modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background ) { GreetingText(message = "Happy Birthday Sam!") } } } } }
@Preview(showBackground = true) @Composable fun BirthdayCardPreview() { HappyBirthdayTheme { GreetingText(message = "Happy Birthday Tauseef!") } }
@Composable fun GreetingText(message: String, modifier: Modifier = Modifier) { Text( text = message, modifier = modifier ) }
Describe the problem
Can't run the code showing 5 errors
Steps to reproduce?
Versions Android Studio version: Android studio Koala API version of the emulator: api 35
Additional information Include screenshots if they would be useful in clarifying the problem.