I am noob in Android. I just started to use ActionBarActivity
over FragmentActivity
. Is there any difference between them ??
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答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
回答2:
ActionBarActivity
extends FragmentActivity
and adds support for the appcompat
action bar backport.