title: Can't save longitude in Room database
body: <p>I've recently encountered an extremly strange proble while developing my simple location based app.</p>
  <p>Basically, what I'm trying to achieve is getting <code>LatLng</code> object from <code>OnMapClickListener</code>, saving its <code>latitude</code> and <code>longitude</code> into Room using Dao, and then retrieving them in some other object (<code>fusedLocationProviderClient</code> `s locationCallback to be exact).</p>
  <h2>Code</h2>
  <p><strong>Destination</strong> - a simple Room Entity which has lat, lng, and timestamp as a primary key.</p>
  <pre><code>@Entity(tableName = &quot;destinations&quot;)
  data class Destination(
          @PrimaryKey var timestamp: Long = 0L,
          var lat: Double = -1.0,
          var long: Double = -1.0
  )
  </code></pre>
  <p><strong>DestinationDao</strong> - to access Room.</p>
  <pre><code>@Dao
  interface DestinationDao {
  
      // Get the newest destination
      @Query(&quot;SELECT * FROM destinations WHERE timestamp = (SELECT MAX(timestamp) FROM destinations)&quot;)
      fun getDestination(): Destination?
  
      @Insert(onConflict = OnConflictStrategy.REPLACE)
      fun insertDestination(destination: Destination)
  }
  </code></pre>
  <p><strong>MapsActivity</strong> - the place where I get coordinates from user click and save them into SQLite using Room</p>
  <pre><code>map.setOnMapClickListener { latLng -&gt;
              val destination = Destination(System.nanoTime(), lat = latLng.latitude, long = latLng.longitude)
              
              Log.d(TAG, destination.toString())
              AppDatabase.getInstance(this).destinationDao().insertDestination(destination)
              Log.d(TAG, AppDatabase.getInstance(this).destinationDao().getDestination().toString())
          }
  </code></pre>
  <p><strong>MyLocationListener</strong> - the place where I retrieve my coordinates from Room</p>
  <pre><code>private val locationCallback = object : LocationCallback() {
          override fun onLocationResult(userLocation: LocationResult?) {
              val array = FloatArray(1)
              val destination = AppDatabase.getInstance(appContext).destinationDao().getDestination()
  
              Log.d(TAG, &quot;Distance: ${array[0]} m\nlat: ${destination!!.lat}, long: ${destination.long}&quot;)
          }
      }
  </code></pre>
  <h2>The problem</h2>
  <p>It seems simple, but for an unknown reason, longitude never gets saved to Room! To better illustrate this, here are the logs from that <code>MapsActivity</code> snippet (-1.0 is a default value)</p>
  <pre><code>// Destination created from `LatLng` object from map click listener
  D/MapsActivity: Destination(timestamp=248767407310345, lat=50.1813350498603, long=18.45104455947876)
  // Destination retrieved from  Room
  D/MapsActivity: Destination(timestamp=248767407310345, lat=50.1813350498603, long=-1.0)
  </code></pre>
  <p>I have completely no idea why is that. I tried changing Double to String and then parsing it, tried reducing the count of decimal places, I even tried changing the order of variables declaration in <code>Destination</code> class - nothing works.</p>
  <p>If any additional data is needed, I'll post it.
  Thank you in advance.</p>