Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I replace ActionBarActivity with AppCompatActivity?

I am following an Android lesson and under the Support Android 2.1 and Above section it is said my Activity should extend the ActionBarActivity class to support Action Bar on API-7 onwards.

However, documentation also says that this class is deprecated and I should use AppCompatActivity instead. I'm confused here, which one should I use and why?

like image 776
Not Gabriel Avatar asked May 26 '15 15:05

Not Gabriel


1 Answers

Yes. You should use AppCompatActivity.

The AppCompatActivity is a very new class and the training section on the android website is outdated.

Everything that you would do with ActionBarActivity will work mostly the same on AppCompatActivity.

For differences please read the post about it http://android-developers.blogspot.de/2015/04/android-support-library-221.html

like image 77
Budius Avatar answered Sep 23 '22 12:09

Budius