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