I was using Android Studio for Jetpack Compos, and now I do not have my device because I am in another country. I went to Android ide and was trying to make an application using Compos, but the expected result in both cases is a white screen. Hope help me fast to solve it
Here is my code
I was using Android Studio for Jetpack Compos, and now I do not have my device because I am in another country. I went to Android ide and was trying to make an application using Compos, but the expected result in both cases is a white screen. Hope help me fast to solve it Here is my code [code]package com.example.birthdayproject
@Composable fun BirthdayGreeting(name: String) { Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { Column( modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally ) { Icon( painter = painterResource(id = R.drawable.birthday_cake), // Replace with your icon contentDescription = "Birthday Cake" ) Spacer(modifier = Modifier.height(16.dp)) Text(text = "Happy Birthday, $name!") // Add more birthday-themed elements here (optional) } }
@Override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { MyComposeApplicationTheme { var showGreeting by remember { mutableStateOf(false) } var name by remember { mutableStateOf("") }
if (!showGreeting) { EnterNameScreen { enteredName -> name = enteredName showGreeting = true } } else { BirthdayGreeting(name) } } } } } } [/code] And the results (https://i.stack.imgur.com/irYgU.jpg)](https://i.stack.imgur.com/irYgU.jpg)