When using Jetpack Compose, by default it extends the ComponentActivity
class. But after trying some samples I switched to AppCompatActivity
and everything seemed to work fine. So I wonder what the difference between these is. Do any additional features come with ComponentActivity
?
AppCompatActivity
extends FragmentActivity
which extends ComponentActivity
.
ComponentActivity
has all you need for a Compose-only app.
If you need AppCompat APIs, an AndroidView
which works with AppCompat or MaterialComponents theme, or you need Fragment
s then use AppCompatActivity
.
Note: it requires at least the AppCompat 1.3.0
version.