title: " .info/serverTimeOffset" from Firebase database Not refreshing
body: <p>I'm building an app where time sycing between users is an important task. So i'm using Firebase .info/serverTimeOffset for getting time offset in my MainActivity "OnCreate" and stores in a shared preference, so that the app can use this variable in all my fragments. I'll use this offset value and elapsed real time to calculate Actual time. Even if the user changes the system time(for cheating) when app is running the actual time will not change, since i'm using elapsed real time. Problem comes when the user close the app, changes the system time and reopens the app immediatley. In this case the .info/serverTimeOffset is again called which returns the same offset(not refreshing). From the internet solutions, i've tried putting "FirebaseDatabase.getInstance().goOffline() and FirebaseDatabase.getInstance() &amp; goOnline()", still the issue persists. Following is the code, </p>
  
  <pre><code>
      class MainActivity : AppCompatActivity() {
  
  
          override fun onCreate(savedInstanceState: Bundle?) {
              super.onCreate(savedInstanceState)
              setContentView(R.layout.activity_main)
              Log.i("ph","MainActivity OnCreate")
              calculateDelay(this)
          }
  
          override fun onDestroy() {
              super.onDestroy()
              Log.i("ph","MainActivity OnDestroy")
          }
  
          private fun calculateDelay(ac: Context) {
              FirebaseDatabase.getInstance().goOffline()
              FirebaseDatabase.getInstance().goOnline()
              val offsetRef = FirebaseDatabase.getInstance().getReference(".info/serverTimeOffset")
              offsetRef.addListenerForSingleValueEvent(object : ValueEventListener {
                  override fun onDataChange(snapshot: DataSnapshot) {
  
                      val systemTimeOffset = snapshot.getValue(Long::class.java) ?: 0L
                      val estimatedOffset =
                          System.currentTimeMillis() + systemTimeOffset - SystemClock.elapsedRealtime()
                      val estimatedServerTimeMs =
                          estimatedOffset + SystemClock.elapsedRealtime()
                      Log.i("ph","Main Time " + getdate(estimatedServerTimeMs, "dd/MM/yyyy hh:mm:ss.SSS"))
                      val sPreference = SPreference(ac) // my preference class 
                      sPreference.putTD(estimatedOffset) // saving to preference
                  }
  
                  override fun onCancelled(p0: DatabaseError) {
                      TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
                  }
              })
          }
      }
  
  </code></pre>
  
  <p>How to referesh .info/serverTimeOffset ?</p>