Back to project page tasktracker-android.
The source code is released under:
Copyright (c) 2012 Remo Mueller https://github.com/remomueller This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this lice...
If you think the Android project tasktracker-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.github.remomueller.tasktracker.android; /*from w ww . j ava2 s . c o m*/ import android.app.Application; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import com.github.remomueller.tasktracker.android.util.DatabaseHandler; public class TaskTracker extends Application { private DatabaseHandler dbHandler; private static TaskTracker mSelf; public synchronized static SQLiteDatabase db() { if(self().dbHandler == null) { self().dbHandler = new DatabaseHandler(context()); } return self().dbHandler.getWritableDatabase(); } public static Context context() { return self(); } @Override public void onCreate() { super.onCreate(); mSelf = this; } private static TaskTracker self() { return mSelf; } // public synchronized static DatabaseHandler db() { // if(this.dbHandler == null) { // this.dbHandler = new DatabaseHandler(); // } // return this.dbHandler.getWritableDatabase(); // } }