我工作的片段,并遇到了两件事活动
和 FragmentActivity
这是多次使用。我想知道,有没有这两者之间有什么区别,因为当我改变了活动
与 FragmentActivity
,它没有在应用效果。
I was working on fragments and came across two things Activity
and FragmentActivity
which are used several times. I want to know that is there any difference between these two, because when I changed Activity
with FragmentActivity
, it had no effect on the app.
A FragmentActivity
是活动的一个子类
这是专为在 Android的支持包。
A FragmentActivity
is a subclass of Activity
that was built for the Android Support Package.
在 FragmentActivity
类增加了一些新的方法,以确保与旧版本的Android的兼容性,但除此之外,真的没有多少两者之间的区别。只要确保你改变所有呼叫 getLoaderManager()
和 getFragmentManager()
到 getSupportLoaderManager( )
和 getSupportFragmentManager()
分别的。
The FragmentActivity
class adds a couple new methods to ensure compatibility with older versions of Android, but other than that, there really isn't much of a difference between the two. Just make sure you change all calls to getLoaderManager()
and getFragmentManager()
to getSupportLoaderManager()
and getSupportFragmentManager()
respectively.
下一篇:IllegalStateException异常:用的onSaveInstanceState后ViewPager无法执行此操作异常、操作、IllegalStateException、ViewPager