操作栏片段活动片段、操作

2023-09-06 00:59:06 作者:牛奶萌男

我triying从actionbarsherlock我的应用程序迁移到谷歌的actionbarcompat,但ActionBarFragmentActivity不存在。我一定要使用ActionBarActivity或有另一种方式?

I'm triying to migrate my app from actionbarsherlock to Google's actionbarcompat, but ActionBarFragmentActivity does not exist. Do I have to use ActionBarActivity or there is another way?

在此先感谢, 迭戈。

推荐答案

看这里。这将帮助你。

http://android-developers.blogspot.in/2013/08/actionbarcompat-and-io-2013-app-source.html

这是摘录:

扩展活动的类ActionBarCompat:    ActionBarCompat包含一个Activity类,所有的活动课的应该延伸:ActionBarActivity 的   这个类本身从FragmentActivity扩展,所以你可以继续使用碎片的应用程序。没有,你需要扩展ActionBarCompat片段类,所以你应该继续使用android.support.v4.Fragment为您片段的基类。

Extend Activity classes from ActionBarCompat: ActionBarCompat contains one Activity class which all of your Activity classes should extend: ActionBarActivity. This class itself extends from FragmentActivity so you can continue to use Fragments in your application. There is not a ActionBarCompat Fragment class that you need to extend, so you should continue using android.support.v4.Fragment as the base class for your Fragments.

 
精彩推荐
图片推荐