简体   繁体   English

Android:无法解析FragmentActivity的TabManager类

[英]Android: TabManager class can't be resolved, inheriting from FragmentActivity

I am following the example here 我在这里跟随例子

http://developer.android.com/reference/android/app/TabActivity.html http://developer.android.com/reference/android/app/TabActivity.html

creating tabs using fragments and in the tutorial it uses TabManager but on my version it says it cannot be resolved. 使用片段创建选项卡,在本教程中使用TabManager,但在我的版本中说无法解决。

I am using minsdk set to 14 and targetsdk set to 15. 我正在使用minsdk设置为14和targetsdk设置为15。

I don't wish to use the backward compatible support. 我不希望使用向后兼容的支持。

Any ideas which package it is in? 有什么想法吗?

Eclipse doesn't provide me any help, only asks me to create the class TabManager. Eclipse没有提供任何帮助,仅要求我创建类TabManager。

Thanks in advance 提前致谢

TabManager is for the compatibility fragment tabs, not for the 3.0+ fragment tabs. TabManager用于兼容性片段选项卡,而不用于3.0+片段选项卡。 That's why it can't be resolved. 这就是为什么它无法解决。

The tutorial here shows how to create fragment tabs in 3.0+: 这里的教程显示了如何在3.0+中创建片段选项卡:

http://developer.android.com/reference/android/app/ActionBar.html#newTab () http://developer.android.com/reference/android/app/ActionBar.html#newTab ()

Also, you don't have to inherit from FragmentActivity starting in Honeycomb unless you want backwards compatibility. 另外,除非需要向后兼容,否则不必从Honeycomb开始从FragmentActivity继承。 You can just inherit from Activity and Fragment will be supported. 您只可以从Activity继承,就可以支持Fragment

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM