不如打靶分14 API(ICS)时,使用FragmentActivity(或ActionBarActivity)或系统的活动? [英] Better to use FragmentActivity (or ActionBarActivity) or system Activity when targetting min API 14 (ICS)?
问题描述
我在做我的应用程序有4.0(ICS,API级别14)最低Android版本。
首先,我猜,我可以摆脱使用 FragmentActivity
作为活动的基类,但似乎有些支持库类,如 FragmentStatePagerAdapter
不可用的系统框架,它需要的片段
而不是系统的支持片段
。
所以我想如果我应该让我的活动从系统继承活动
,还是留用 FragmentActivity
(或 ActionBarActivity
使用appcompat库时)?
一些支持库类,如FragmentStatePagerAdapter不可对系统架构,它需要系统片段的支持片段来代替。
这是不正确。有两个版本 FragmentPagerAdapter
和 FragmentStatePagerAdapter
的。其中一组( V4
)使用反向移植,其他的( V13
)使用本机API级别11版本的片段。
我不知道我应该让我的活动从系统中活动继承
是的,除非你需要嵌套的片段。那些没有露面,直到API级别17,如果你需要的功能,您将需要使用反向移植,直至为你的安卓的minSdkVersion
是17或更高。
I'm making my app to have minimum Android version of 4.0 (ICS, API level 14).
First I guessed that I can get rid of using FragmentActivity
as the base class for the activities, but it seems that some support library classes like FragmentStatePagerAdapter
is not available on the system framework, and it needs the support Fragment
instead of the system Fragment
.
So I wonder if I should make my activities inherit from the system Activity
, or stay using FragmentActivity
(or ActionBarActivity
when using appcompat library)?
some support library classes like FragmentStatePagerAdapter is not available on the system framework, and it needs the support Fragment instead of the system Fragment.
That is incorrect. There are two versions of FragmentPagerAdapter
and FragmentStatePagerAdapter
. One set (v4
) uses the backport, the other (v13
) uses the native API Level 11 version of fragments.
I wonder if I should make my activities inherit from the system Activity
Yes, unless you need nested fragments. Those did not show up until API Level 17. If you need that capability, you will need to use the backport, until such time as your android:minSdkVersion
is 17 or higher.
这篇关于不如打靶分14 API(ICS)时,使用FragmentActivity(或ActionBarActivity)或系统的活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!