package com.wen.bangumi;

import android.app.Application;
import android.database.sqlite.SQLiteDatabase;

import com.wen.bangumi.greenDAO.DaoMaster;
import com.wen.bangumi.greenDAO.DaoSession;

/**
 * Created by BelieveOP5 on 2017/1/26.
 */

public class Bangumi extends Application {

    private static Bangumi INSTANCE;

    private DaoSession mDaoSession;

    public static Bangumi getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new Bangumi();
        }
        return INSTANCE;
    }

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

        INSTANCE = this;

        //设置数据库连接
        DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "bangumi-db", null);
        SQLiteDatabase db = helper.getWritableDatabase();
        mDaoSession = new DaoMaster(db).newSession();

    }

    public DaoSession getDaoSession() {
        return mDaoSession;
    }
}

@@ -354,16 +354,60 @@
 ssion;%0A%0A
+%0A    /**%0A     * %E8%8E%B7%E5%8F%96%E5%AE%9E%E4%BE%8B%0A     * @return%0A     */%0A
     publ

Change Something.