由于没有时间去google官网上仔细查API上的介绍(需要仔细查找和翻译),所以在直接在google中搜索了一下,其中关于什么时候用那个activity类,有如下回答比较满意(http://stackoverflow.com/questions/31297246/activity-appcompatactivity-fragmentactivity-and-actionbaractivity-when-to-us):
Activity
is the base class of all other activities, I don't think it will be deprecated. The relationship among them is:
Activity
<- FragmentActivity
<- AppCompatActivity
<- ActionBarActivity
'<-' means inheritance here. The reference said ActionBarActivity
is deprecated, use AppCompatActivity
instead.
So basically, using AppCompatActivity
is always the right choise. The differences between them:
Activity
is the basic one.- Based on
Activity
,FragmentActivity
provides the ability to useFragment
. - Based on
FragmentActivity
,AppCompatActivity
provides features toActionBar