如图MainActivity跳转到指定的home模块的HomeActivity,可是在HomeActivity里通过@Autowired 修饰的Long age 属性却为空,我们点进withLong()方法以后才发现这个参数其实是long 类型的,所以HomeActivity的age 属性是小写的long 。如果写成大写的Long 不仅当前age 为null,其他属性也为null或者默认值。如果你也遇到此问题记得点进相应方法,看看里面具体的类型。


如图MainActivity跳转到指定的home模块的HomeActivity,可是在HomeActivity里通过@Autowired 修饰的Long age 属性却为空,我们点进withLong()方法以后才发现这个参数其实是long 类型的,所以HomeActivity的age 属性是小写的long 。如果写成大写的Long 不仅当前age 为null,其他属性也为null或者默认值。如果你也遇到此问题记得点进相应方法,看看里面具体的类型。
本文标题:解决阿里Aroute的@Autowired 修饰的属性值为nul
本文链接:https://www.haomeiwen.com/subject/xiwvtctx.html
网友评论