如何删除警告“.productAdapter”从未在本地读取过?
我对 Android 开发非常陌生。当我构建项目时,我收到警告。警告是:
字段 SavedSalesHistoryList.productAdapter 永远不会在本地读取。
有人可以帮助我吗?
提前感谢
I am very new in android Development. I am getting a warning when i build my project. waring is:
The field SavedSalesHistoryList.productAdapter is never read locally.
Can any one help me?
Thanx in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这意味着您从未真正使用过该物品。您可以安全地删除或注释它的声明。您正在浪费 CPU 周期为其分配内存并且从不使用它,然后让它被垃圾收集(如果是对象)。诚然,像这样的小事情不会影响每个项目的性能,但它可以使代码更清晰。
It means you never actually used that item. You can safely delete or comment it's declaration out. You're wasting CPU cycles allocating memory to it and never using it, then letting it get garbage collected (if an object). Granted, small things like this wont impact the performance of EVERY project, but it makes for cleaner code.
这应该意味着您的情况下没有使用私有变量
productAdapter
。您可以安全地从SavedSalesHistoryList
类中删除它。It should mean that a private variable,
productAdapter
in your case, is not being used. You can safely delete it from theSavedSalesHistoryList
class.