0
 if(addressList.get(0).getLatitude() != null){

    fullAddress += addressList.get(0).getLatitude() + " ";

  }
Abhishek
  • 3,348
  • 3
  • 15
  • 34
Chen Boro
  • 9
  • 1
  • 5

1 Answers1

1

You can only compare Object types with null

Since double is a primitive and not an Object you cannot compare it with null. Compare it with number:

if(addressList.get(0).getLatitude() != 0){

}

Where 0 is the default value of Latitude.

Check out this SO for comparing doubles properly.

Sagar
  • 23,903
  • 4
  • 62
  • 62