Skip to content Skip to sidebar Skip to footer

Difference Between Actionbaractivity And Fragment Activity

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

Solution 1:

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

Solution 2:

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

Post a Comment for "Difference Between Actionbaractivity And Fragment Activity"