i have the following line of code which displays the following warning:
HashMap<String,String> currentItem = (HashMap<String,String>) adapter.getItemAtPosition(position);
// Warning: Type Safety: Unckecked cast from Object to HashMap <String,String>
How can i get rid of this warning?
Have the getItemAtPosition method return a generic HashMap, so you don't have to cast it. Either that or use the appropriate annotation -- @SuppressWarnings("unchecked")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With