summaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common/os
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/jogamp/common/os')
-rw-r--r--src/java/jogamp/common/os/android/StaticContext.java19
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;
}
}