From ae3756ff570f2c274fca005c50028101aef176e9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 9 Apr 2012 04:13:26 +0200 Subject: ActivityLauncher/LauncherUtil: Clear properties 'onDestroy()' --- src/java/jogamp/common/os/android/StaticContext.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/java/jogamp/common/os/android/StaticContext.java') diff --git a/src/java/jogamp/common/os/android/StaticContext.java b/src/java/jogamp/common/os/android/StaticContext.java index cb55e65..055fa2f 100644 --- a/src/java/jogamp/common/os/android/StaticContext.java +++ b/src/java/jogamp/common/os/android/StaticContext.java @@ -27,26 +27,29 @@ */ package jogamp.common.os.android; -import android.content.*; +import android.content.Context; import android.util.Log; public class StaticContext { - private static Context context = null; + private static Context appContext = null; private static boolean DEBUG = false; - public static final synchronized void init(Context ctx) { - if(null != context) { + /** + * @param appContext mandatory application Context + */ + public static final synchronized void init(Context appContext) { + if(null != StaticContext.appContext) { throw new RuntimeException("Context already set"); } - if(DEBUG) { Log.d(MD.TAG, "init("+ctx+")"); } - context = ctx; + if(DEBUG) { Log.d(MD.TAG, "init(appCtx "+appContext+")"); } + StaticContext.appContext = appContext; } public static final synchronized void clear() { if(DEBUG) { Log.d(MD.TAG, "clear()"); } - context = null; + appContext = null; } public static final synchronized Context getContext() { - return context; + return appContext; } } -- cgit v1.2.3