com.google.firebase.database.DatabaseException: Calls to setPersistenceEnabled() must be made before any other usage of FirebaseDatabase instance : <p>I am having a problem when I try to setPersistence in fIREBASE,can someone please explain on how to go about it,</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_meal_details);

        if (mDatabase == null) {
            mDatabase = FirebaseDatabase.getInstance().getReference();
            FirebaseDatabase.getInstance().setPersistenceEnabled(true);
            // ...
        }


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