I want to check first if spinner has null values based on the following:
String Name= spinnerName.getSelectedItem().toString(); if(Name != null) { } els
Do not add toString(). If you add toString() it tries to convert null to String, then it throws Exception.
toString()
null
String
Exception
if(spinnerName.getSelectedItem() !=null ) { name = spinnerName.getSelectedItem().toString(); }