When I create a new Empty Activity project in Android Studio (Koala 2024.1.1. patch) Android studio creates a MainActivity.kt file with this code in the MainActivity class:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
FlowDemoTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Greeting(
name = "Android",
modifier = Modifier.padding(innerPadding)
)
}
}
}
}
}
Just created a new Empty Activity project. Created it as always with no coding problems or errors.
Is there a way to change this default code to implement the Surface object instead of Scaffold? Most training videos/books (and yes, I am just learning this stuff now) use Surface instead of Scaffold. Couldn’t find anyplace to change this setting if this is even possible?
Thanks in advance,
Scott M.
Scott Malinowski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1