Darren Lambert
07/22/2021, 8:20 PMclass MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
// A surface container using the 'background' color from the theme
Surface(color = MaterialTheme.colors.background) {
Greeting("Android")
}
}
}
}
@Composable
fun Greeting(name: String) {
Text(text = "Hello $name!")
}
@Preview(showBackground = true,name="Text Preview")
@Composable
fun DefaultPreview() {
Greeting("Android")
}
Message of the error :
Attach Msg Error.txt
:/Darren Lambert
07/22/2021, 8:40 PMAbhishek Dewan
07/23/2021, 2:49 AMAbhishek Dewan
07/23/2021, 2:49 AMChachako
07/23/2021, 5:39 AMDarren Lambert
07/23/2021, 1:44 PMDarren Lambert
07/23/2021, 1:46 PM