Q:

Android: When a spinner has no answer, code falls over

I've got 3 spinners and they're doing the age old fun of when spinner one is selected it updates spinner two etc.
I've got a routine that when a spinner is changed, it runs this to update an edittext field with the values from the spinners.
However when the page loads it falls over (i'm assuming as theres nothing in spinner 3?)
public void updateLocalDesc(){

   AssetType = spnAssetType.getSelectedItem().toString();     
       AssetGroup = spnAssetGroup.getSelectedItem().toString();

       if(!spnAssetSubGroup.getSelectedItem().toString().equals("")){
           AssetSubGroup = spnAssetSubGroup.getSelectedItem().toString();
           tbLongDescription.setText(AssetType + " - " + AssetGroup + " - " + AssetSubGroup);
       } else
       {
           tbLongDescription.setText(AssetType + " - " + AssetGroup);
       }

}

As you can see i'm trying to protect out of it. My errors are: http://pastebin.com/y6x5iPNW

A:

What line is the null pointer on? I imagine that it's on 
if(!spnAssetSubGroup.getSelectedItem().toString().equals(""))

You should do a null check on spnAssetSubGroup.getselectedItem() before calling toString() on it. Something like:
if(spnAssetSubGroup.getSelectedItem() != null && !spnAssetSubGroup.getSelectedItem().toString().equals(""))

The error could also be on
AssetType = spnAssetType.getSelectedItem().toString();     
AssetGroup = spnAssetGroup.getSelectedItem().toString();

getSelectedItem() returns null when there is no item selected, so you need to make sure to null check if some spinners aren't going to have anything selected initially.

