src/com/europalab/caldavsyncadapter/Appctxpro.java

Sat, 14 Feb 2015 00:28:10 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 14 Feb 2015 00:28:10 +0100
branch
ICAL4J_EMBED_1
changeset 21
af4693956263
permissions
-rw-r--r--

Implement a quasi singleton to access the main application context,
and use this as a alternative solution to ical4j correction but
unfortunately this doesn't work either as too many errors are
in the embedded library.

michael@21 1 /**
michael@21 2 * Copyright © 2015, Michael Schloh von Bennewitz
michael@21 3 *
michael@21 4 * This project source file is free software: you can redistribute
michael@21 5 * it and/or modify it under the terms of the GNU General Public License
michael@21 6 * as published by the Free Software Foundation, either version 3 of the
michael@21 7 * License, or at your option any later version.
michael@21 8 *
michael@21 9 * Andoid Caldav Sync Adapter Free is distributed in the hope that
michael@21 10 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
michael@21 11 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
michael@21 12 * GNU General Public License for more details.
michael@21 13 *
michael@21 14 * You should have received a copy of the GNU General Public License
michael@21 15 * along with Andoid Caldav Sync Adapter Free.
michael@21 16 * If not, see <http://www.gnu.org/licenses/>.
michael@21 17 */
michael@21 18
michael@21 19 package com.europalab.caldavsyn;
michael@21 20
michael@21 21 import android.app.Application;
michael@21 22 import android.content.Context;
michael@21 23
michael@21 24 public class Appctxpro extends Application {
michael@21 25 // Store a app context reference
michael@21 26 private static Context sContext;
michael@21 27
michael@21 28 // Construct a ctx provider
michael@21 29 public Appctxpro() {
michael@21 30 super();
michael@21 31 sContext = this;
michael@21 32 }
michael@21 33
michael@21 34 // Context accessor methods
michael@21 35 public static Context getContext() {
michael@21 36 return sContext;
michael@21 37 }
michael@21 38 public static void setContext(Context aContext) {
michael@21 39 sContext = aContext;
michael@21 40 }
michael@21 41 }

mercurial