Difference between ActionBarActivity and Fragment Activity
Asked Answered
P

2

7

I am noob in Android. I just started to use ActionBarActivity over FragmentActivity. Is there any difference between them ??

Pandiculation answered 13/4, 2014 at 16:48 Comment(0)
C
19

FragmentActivity is the base class for support based fragments. So you will be using Fragment from support library below api level 11 in which case your Activity needs to extend FragmentActivity.

 ↳  android.support.v4.app.FragmentActivity
                       ↳    android.support.v7.app.ActionBarActivity

You will use ActionBarActivity when you need actionbar below API level 11 by using AppCompat library. In this case your Activity extends ActionBarActivity.

As you see ActionBarActivity extends FragmentActivity

Causation answered 13/4, 2014 at 16:52 Comment(4)
How developers were adding action bar + Fragments when ActionBarActivity was not there ?Pandiculation
@user3527017 they used a third party library called ActionBarSherlock. actionbarsherlock.comCausation
All backward compatibility classes are in v4 right and what is v7 ?Pandiculation
@user3527017 why don't you check the docs yourself developer.android.com/tools/support-library/index.htmlCausation
L
13

ActionBarActivity extends FragmentActivity and adds support for the appcompat action bar backport.

Layton answered 13/4, 2014 at 16:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.