0
Map<String,?> one = (Map<String,?>) parent.getAdapter().getItem(position);
Type safety: Unchecked cast from Object to Map<String,?>
我如何摆脱“未经检查的投射”警告?
与上面的代码行我得到选中铸警告。对我来说,获得相同结果但减轻警告的最佳方式是什么?
Map<String,?> one = (Map<String,?>) parent.getAdapter().getItem(position);
Type safety: Unchecked cast from Object to Map<String,?>
我如何摆脱“未经检查的投射”警告?
与上面的代码行我得到选中铸警告。对我来说,获得相同结果但减轻警告的最佳方式是什么?
此标注添加到方法:
@SuppressWarnings("unchecked") // Object to Map.
务必评论它 - 在一个大的方法,它可能不是很明显。
thx工作。 – texasman1979
可能重复的[类型安全:未经检查的转换](http://stackoverflow.com/questions/262367/type-safety-unchecked-cast) –
“父”的类型是什么? –