Difference between ActionBarActivity and Fragment

2019-02-07 06:06发布

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

2条回答
你好瞎i
2楼-- · 2019-02-07 06:15

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

查看更多
Viruses.
3楼-- · 2019-02-07 06:18

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

查看更多
登录 后发表回答