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

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

  }
Abhishek
  • 3,308
  • 2
  • 15
  • 31
Chen Boro
  • 9
  • 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
  • 22,451
  • 4
  • 56
  • 59