how do i get rid of a "Unchecked cast" warning?
Map<String,?> one = (Map<String,?>) parent.getAdapter().getItem(position);
Type safety: Unchecked cast from Object to Map<String,?>
with the above line of code i get that unchecked cast warning. what is the best way for me to have the same results but alleviat开发者_JAVA百科e that warning?
Add this annotation to the method:
@SuppressWarnings("unchecked") // Object to Map.
Be sure to comment it -- in a large method it may not be obvious.
精彩评论