package com.naijab.nextzytimeline;

import android.app.Application;

import io.realm.Realm;
import io.realm.RealmConfiguration;

public class NextzyApp extends Application{

    @Override
    public void onCreate() {
        super.onCreate();

        initRealm();

    }

    private void initRealm() {
        Realm.init(getApplicationContext());
        RealmConfiguration realmConfiguration = new RealmConfiguration.Builder()
                .name(Realm.DEFAULT_REALM_NAME)
                .schemaVersion(0)
                .deleteRealmIfMigrationNeeded()
                .build();
        Realm.setDefaultConfiguration(realmConfiguration);
    }
}

@@ -60,16 +60,48 @@
 ication;
+%0Aimport android.content.Context;
 %0A%0Aimport
@@ -199,16 +199,54 @@
 ation%7B%0A%0A
+    private static Context mContext;%0A%0A
     @Ove
@@ -310,30 +310,126 @@
 ();%0A
-%0A        initRealm();%0A
+        mContext = this;%0A        initRealm();%0A%0A    %7D%0A%0A    public static Context getContext()%7B%0A        return mContext;
 %0A   

Add Context