片段或支持片段?

编程入门 行业动态 更新时间:2024-10-23 04:57:08
本文介绍了片段或支持片段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发支持Android的> = 4.0的应用程序。它使用了 android.app 包片段。由于我所面临的问题与旧片段实施4.0,如这个,那已经固定在支持库,我正在考虑切换回片段实现从支持库,以获得更可靠和一致的实施。

I am developing an app that supports Android >= 4.0. It uses fragments from the android.app package. As I am facing problems with the older fragment implementation in 4.0, like this one, that are already fixed in the support library, I am considering switching back to the fragment implementation from the support library to get a more reliable and consistent implementation.

为您的意见对这个怎么办?您是否正在使用从支持库的片段,即使它们已经上市,为Android开发4时?

What is your opinion on this? Are you using fragments from the support library, even though they are already available, when developing for Android 4?

推荐答案

根据我的经验,使用相同的片段执行的所有Android设备是一个很大的优势。我无法摆脱所有NullPointerException异常时,状态保存在Android 4.0使用原生片段,与支持库,他们都走了。我也看不出任何缺点到目前为止,这种做法。

From my experience, using the same fragment implementation on all Android devices is a great advantage. I could not get rid of all NullPointerExceptions when state is saved on Android 4.0 using native fragments, with the support library they are all gone. Also I could not see any disadvantage so far with this approach.

所以,我的回答我自己的问题现在是:在开发针对Android 4.x中,用碎片的支持库是一个好主意。支持库已修复的错误仍在present老年片段实现,并经常更新,更多的bug修复。

So my answer to my own question is now: When developing for Android 4.x, using the fragments from the support library is a good idea. The support library has bugs fixed that are still present in older fragment implementations and is frequently updated with more bug fixes.

更多推荐

片段或支持片段?

本文发布于:2023-10-16 05:38:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496653.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:片段

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!