-2

What is the difference between "class A extends Activity" and "class A extends AppCompactActivity" in android ? Means both perform almost same work for us ,Then what is the difference between them?. I know the difference is related to something v4 & v7 version support. Please Explain me in Deep about these? Also Explain The Difference between V4 and V7 Version in Android?? Also Explain Difference between Activity and Fragment Activity?? Thanks in Advance..

  • Possible duplicate of [Activity, AppCompatActivity, FragmentActivity, and ActionBarActivity: When to Use Which?](http://stackoverflow.com/questions/31297246/activity-appcompatactivity-fragmentactivity-and-actionbaractivity-when-to-us) – Rajasekhar May 02 '17 at 07:32

1 Answers1

-1

AppCompatActivity is the direct child class of FragmentActivity of support v4 and the direct parent class of ActionBarActivity .You can add an ActionBar to your activity when running on API level 7 or higher by extending this class for your activity and setting the activity theme to Theme.AppCompat or a similar theme.

Activity:by extending Activity you can avoid adding additional projects/libraries to your project but you'll lack the ActionBar on api levels below 11