amitshekhariitbhu / android-interview-questions

Your Cheat Sheet For Android Interview - Android Interview Questions and Answers
https://outcomeschool.com
Apache License 2.0
11.2k stars 2.22k forks source link

What is AppCompatActivity ? #90

Open capturemathan opened 4 years ago

capturemathan commented 4 years ago

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:

archow commented 10 months ago

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

amitshekhariitbhu commented 10 months ago

I will add this. Keeping it open for now.