怎么使用兼容性库转换为整理碎片时做一下ListActivity / MapActivity?兼容性、转换为、碎片、MapActivity

2023-09-05 00:16:38 作者:Beak Hyun。

我使用兼容性库转换现有应用程序的片段API。我读过你应该更新类,扩展活动,以现在使用FragmentActivity。这是对大多数情况下,但对于类,扩展ListActivity或MapActivity?什么是preferred的方式来处理呢?我希望有一个ListFragmentActivity或类似的规定,但我没有看到一个。

I'm converting an existing app to the Fragments API using the compatibility library. I've read that you're supposed to update classes that extend Activity to now use FragmentActivity. This is fine for most cases, but what about classes that extend ListActivity or MapActivity? What is the preferred way to handle this? I was hoping there was a ListFragmentActivity or something along those lines, but I don't see one.

推荐答案

有一个ListFragment:的 http://developer.android.com/reference/android/app/ListFragment.html

There is a ListFragment: http://developer.android.com/reference/android/app/ListFragment.html

有关MapActivity,不幸的是,你将需要继续使用;没有它片段API。

For MapActivity, unfortunately you will need to continue to use that; there is no Fragment API for it.