package com.google.firebase.codelab.friendlychat.mvvm;

import android.app.Application;

import com.google.firebase.database.FirebaseDatabase;

/**
 * Created by VTCA on 6/19/2016.
 */
public class App extends Application {
    /**
     * Called when the application is starting, before any activity, service,
     * or receiver objects (excluding content providers) have been created.
     * Implementations should be as quick as possible (for example using
     * lazy initialization of state) since the time spent in this function
     * directly impacts the performance of starting the first activity,
     * service, or receiver in a process.
     * If you override this method, be sure to call super.onCreate().
     */
    @Override
    public void onCreate() {

        super.onCreate();

        FirebaseDatabase.getInstance().setPersistenceEnabled(true);
    }
}

@@ -82,16 +82,56 @@
 ation;%0A%0A
+import com.google.firebase.FirebaseApp;%0A
 import c
@@ -830,16 +830,70 @@
 ate();%0A%0A
+        if(!FirebaseApp.getApps(this).isEmpty())%7B%0A    
         
@@ -952,16 +952,27 @@
 (true);%0A
+        %7D%0A%0A
     %7D%0A%7D%0A

Fix crased by FirebaseDatabase.getInstance().setPersistenceEnabled(true);