Java Code Examples for com.google.firebase.database.FirebaseDatabase#setPersistenceEnabled()

The following examples show how to use com.google.firebase.database.FirebaseDatabase#setPersistenceEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FirebaseUtils.java    From Shipr-Community-Android with GNU General Public License v3.0 4 votes vote down vote up
public void dbSetpersistent(FirebaseDatabase db) {
    db.setPersistenceEnabled(true);
}
 
Example 2
Source File: InitContentProvider.java    From white-label-event-app with Apache License 2.0 4 votes vote down vote up
private void initFirebase() {
    final FirebaseDatabase fdb = FirebaseDatabase.getInstance();
    fdb.setPersistenceEnabled(true);
    FirebaseCache.getInstance();
    context.registerActivityLifecycleCallbacks(new GoOfflineWhenInvisible(fdb));
}
 
Example 3
Source File: FirebaseDataManager.java    From Android-MVP-vs-MVVM-Samples with Apache License 2.0 3 votes vote down vote up
public FirebaseDataManager() {
    super();
    final FirebaseDatabase database = FirebaseDatabase.getInstance();
    database.setLogLevel(BuildConfig.DEBUG ? Logger.Level.DEBUG : Logger.Level.NONE);
    database.setPersistenceEnabled(false);

    mDatabase = database.getReference();

    mDatabaseCheckIn = mDatabase.child(TABLE_CHECK_IN);


}