diff options
author | Sven Gothel <[email protected]> | 2012-04-09 04:13:26 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-04-09 04:13:26 +0200 |
commit | ae3756ff570f2c274fca005c50028101aef176e9 (patch) | |
tree | 3dd28aec267eb7a3e3dbcc79dd169f8768aa79d1 /src/java/jogamp/common/os/android | |
parent | 6b5332374ff238b09d44858873d600e4290302f6 (diff) |
ActivityLauncher/LauncherUtil: Clear properties 'onDestroy()'
Diffstat (limited to 'src/java/jogamp/common/os/android')
-rw-r--r-- | src/java/jogamp/common/os/android/StaticContext.java | 19 |
1 files changed, 11 insertions, 8 deletions
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; } } |