代码文件:
布局文件:
真是被搞@_@了
ViewHolder类:
走同样的路,发现不同的人生
Your statement block should not be empty, so a null pointer error will be reported. moduels.tradeModelLabel,而是setText中的内容。 如果moduels.tradeModelLabel为空,上面的if-else
moduels.tradeModelLabel
setText
if-else
If this kind of inexplicable problem occurs, clean or rebuild the project first. Sometimes android studio will miss some codes when compiling..
Change your first judgment to tradeModelString == null If tradeModelString is nullThis sentence will report a null pointer
tradeModelString == null
Your statement block should not be empty, so a null pointer error will be reported.
moduels.tradeModelLabel
,而是setText
中的内容。如果
moduels.tradeModelLabel
为空,上面的if-else
If this kind of inexplicable problem occurs, clean or rebuild the project first. Sometimes android studio will miss some codes when compiling..
Change your first judgment to
tradeModelString == null
If tradeModelString is nullThis sentence will report a null pointer