片段反向移植需要单独的反向移植类和蜂窝类吗?
我是否遗漏了一些重要的东西,或者您是否必须为向后移植的类和本机蜂窝片段维护所有片段的单独版本?
-- 尝试在 honeycomb 上使用向后移植的片段预计会失败并使用本机,而不是因为 ClassCastException 而崩溃
任何帮助将不胜感激。
Am I missing something important in this, or do you have to maintain a seperate version of all your fragments for the backported classes, and for the native honeycomb fragments?
-- Attempting to use the backported fragments on honeycomb was expected to do a fall-through and use the native, not crash because of a ClassCastException
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该只需要扩展兼容性插件附带的 JAR 文件中提供的 Fragment 类。无需为两个平台维护两个类。
查看兼容性下载附带的 API 演示示例,特别是 FragmentLayoutSupport 演示。
顺便说一句,您看到的 ClassCastException 是什么?
You should only need to extend the Fragment classes provided for you in the JAR file that comes with the Compatibility plug-in. No need to maintain two classes for both platforms.
Take a look at the API Demos example that comes with the compatibility download, specifically the FragmentLayoutSupport demo.
Incidentally, what is the ClassCastException you are seeing?
,在这种情况下帮助简单地替换行:
对我来说
for me in this situation helped a simply replacing rows:
on
天哪,我不觉得自己很傻吗?
发现问题 - 我正在运行模拟器的预览版本,我从来没有记得删除它并用 11 级实例替换它 - 在最终的 Honeycomb 模拟器中工作正常。
Oh my, well don't I feel silly.
Found the problem -- I was running a preview version of the emulator, I never remembered to delete it and replace it with a level 11 instance -- works fine in the final Honeycomb emulator.