Firebase gets stuck on no INTERNET connection : <p>In my app, I am using Firebase for database. Now when I am listening for any change in child nodes of a particular location, and if there is no internet connection, no callback gets fired. The firebase call just gets stuck.</p>

<p>I am using this,</p>

<pre><code>FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();
firebaseDatabase.setPersistenceEnabled(true);
</code></pre>

<p>So, persistence is enabled. The problem occurs only one one scenario. When there is no data on the local persistence of Firebase and the internet connection is also not available. </p>

<p>I am using this,</p>

<pre><code>addListenerForSingleValueEvent(new ValueEventListener() {
                        @Override
                        public void onDataChange(DataSnapshot dataSnapshot) {

                        }

                        @Override
                        public void onCancelled(DatabaseError databaseError) {
                            Timber.d("Cancelled");
                        }
                    });
</code></pre>

<p>I am not getting any of the two callbacks for that particular scenario.</p>

<p>What should I do to tackle this kind of scenario? </p>
