ComponentActivity vs AppCompactActivity in android JetpackCompose

Viewed 6674

When using the JetpackCompose in default it extends ComponentActivity class. But after trying some samples I switched to AppCompact activity and everything seems worked fine. So I am wondering what's the difference between these. Do any additional features bring the ComponentActivity?

1 Answers

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 Fragments then use AppCompatActivity.

Note: it requires at least the AppCompat 1.3.0 version.

Related