延伸活动,ActionbarActivity与放大器之间的差异; AppCompactActivity? [英] Difference between extending Activity,ActionbarActivity & AppCompactActivity?

查看:80
本文介绍了延伸活动,ActionbarActivity与放大器之间的差异; AppCompactActivity?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的什么是扩展活动,ActionBarActivity与放大器之间的主要区别; AppCompactActivity?如何将这些类彼此使用方面有什么不同?

In Android what is the main difference between extending Activity,ActionBarActivity & AppCompactActivity? How do these classes differ from each other in terms of usage?

推荐答案

  • 延长<一href="http://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html"><$c$c>ActionBarActivity为您提供 动作条 小号功能每个API级别> = 7
  • 通过扩展 活动 您可避免增加额外的项目/库到您的项目,但你会缺乏 动作条 下面11

修改:更多详细信息:

ActionBarActivity 支持库。支持库用于在旧平台提供新功能。例如,动作条被引入API 11,是活动的一部分默认情况下(根据主题实际上) 。与此相反,没有动作条上了年纪的平台。因此,支持库增加了一个子类活动的(<$ C C $> ActionBarActivity ),提供了动作条的功能和UI

ActionBarActivity is part of the Support Library. Support libraries are used to deliver newer features on older platforms. For example the ActionBar was introduced in API 11 and is part of the Activity by default (depending on the theme actually). In contrast there is no ActionBar on the older platforms. So the support library adds a child class of Activity (ActionBarActivity) that provides the ActionBar's functionality and ui

EDIT2 :2015年更新四月 - 它看起来像 ActionBarActivity 是pcated在德$ P $修订22.1。 0 的支持库。 <一href="http://developer.android.com/reference/android/support/v7/app/AppCompatActivity.html"><$c$c>AppCompatActivity而应使用

edit2: Update April 2015 - it looks like the ActionBarActivityis deprecated in revision 22.1.0 of the Support Library. AppCompatActivity should be used instead.

这篇关于延伸活动,ActionbarActivity与放大器之间的差异; AppCompactActivity?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆