aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common/os/android/StaticContext.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/jogamp/common/os/android/StaticContext.java')
-rw-r--r--src/java/jogamp/common/os/android/StaticContext.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/java/jogamp/common/os/android/StaticContext.java b/src/java/jogamp/common/os/android/StaticContext.java
index 56f8f13..cb55e65 100644
--- a/src/java/jogamp/common/os/android/StaticContext.java
+++ b/src/java/jogamp/common/os/android/StaticContext.java
@@ -32,13 +32,21 @@ import android.util.Log;
public class StaticContext {
private static Context context = null;
+
private static boolean DEBUG = false;
- public static final synchronized void setContext(Context ctx) {
- if(DEBUG) Log.d(MD.TAG, "setContext("+ctx+")");
+ public static final synchronized void init(Context ctx) {
+ if(null != context) {
+ throw new RuntimeException("Context already set");
+ }
+ if(DEBUG) { Log.d(MD.TAG, "init("+ctx+")"); }
context = ctx;
}
+ public static final synchronized void clear() {
+ if(DEBUG) { Log.d(MD.TAG, "clear()"); }
+ context = null;
+ }
public static final synchronized Context getContext() {
return context;
- }
+ }
}