ActionBarActivity和片段活动之间的区别片段、区别、ActionBarActivity

由网友(北巷九命猫)分享简介:我是小白的Andr​​oid系统。我刚开始使用 ActionBarActivity 在 FragmentActivity 。他们之间有?有什么区别I am noob in Android. I just started to use ActionBarActivity over FragmentActivity. I...

我是小白的Andr​​oid系统。我刚开始使用 ActionBarActivity FragmentActivity 。他们之间有?有什么区别

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

推荐答案

FragmentActivity 是支持基于片段的基类。所以,你会使用片段从下面API级别11支持库在这种情况下,你的活动需要扩展 FragmentActivity

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

您将使用 ActionBarActivity 当你需要在下面的ActionBar API级别11利用AppCompat库。在这种情况下,你的活动来延长 ActionBarActivity

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

正如你所看到 ActionBarActivity 扩展 FragmentActivity

阅读全文

相关推荐

最新文章