Android studio 新建工程activity默认继承AppCompatActivity

Activity作为基础,所有Activity直接或间接继承它。FragmentActivity适用于support-v4和support-v13库中的片段回退实现。AppCompatActivity来自appcompat-v7库,主要提供动作栏的回退,还包含对Material Design美学的有限回退。根据minSdkVersion在15-16范围内,如果需要回退的Material Design外观,选择AppCompatActivity;若只需要嵌套片段,选择FragmentActivity;否则,使用基本的Activity。
摘要由CSDN通过智能技术生成

Activity is the baseline. Every activity inherits from Activity, directly or indirectly.

FragmentActivity is for use with the backport of fragments found in the support-v4 and support-v13 libraries. The native implementation of fragments was added in API Level 11, which is higher than your proposed minSdkVersion values. The only reason why you would need to consider FragmentActivity specifically is if you want to use nested fragments (a fragment holding another fragment), as that was not supported in native fragments until API Level 17.

AppCompatActivity is from the appcompat-v7 library. Principally, this offers a backport of the action bar. Since the native action bar was added in API Level 11, you do not need AppCompatActivity for that. However, current versions of appcompat-v7 also add a limited backport of the Material Design aesthetic

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值