android-interview-questions icon indicating copy to clipboard operation
android-interview-questions copied to clipboard

What is AppCompatActivity ?

Open capturemathan opened this issue 5 years ago • 2 comments

Hey guys, this README is filled with plenty of wonderful Questions and I think that addition of What is AppCompatActivity ? under Core Android might be helpful :tada:

capturemathan avatar Jun 23 '20 13:06 capturemathan

I agree! Maybe also include the answer to that as well? Something like: AppCompatActivity extends FragmentActivity, which extends ComponentActivity, and is the recommended class for viewbinding, findViewById, setContentView, using the FragmentManager, and a host of other useful libraries when creating a simple Activity that you usually see in a project.

In newer versions of Android, such as that using JetpackCompose, the lowest base class required for creating a Composable is ComponentActivity, which is a parent of AppCompatActivity. If you are using Jetpack Compose, but would like it to be compatible with non-composable views, AppCompatActivity is the way to go.

For more information about the AppCompatActivity, you can learn here: https://developer.android.com/reference/androidx/appcompat/app/AppCompatActivity

archow avatar Nov 08 '23 19:11 archow

I will add this. Keeping it open for now.

amitshekhariitbhu avatar Nov 09 '23 08:11 amitshekhariitbhu