Upstream version 9.38.204.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / android / core / src / org / xwalk / core / XWalkApplication.java
@@ -2,19 +2,27 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.app.runtime;
+package org.xwalk.core;
 
 import android.app.Application;
+import android.content.Context;
 import android.content.res.Resources;
 
 /**
- * XWalkRuntimeApplication is to support cross package resource loading.
+ * XWalkApplication is to support cross package resource loading.
  * It provides method to allow overriding getResources() behavior.
  */
-public class XWalkRuntimeApplication extends Application {
+public class XWalkApplication extends Application {
+    private static XWalkApplication gApp = null;
     private Resources mRes = null;
 
     @Override
+    public void onCreate(){
+        super.onCreate();
+        gApp = this;
+    }
+
+    @Override
     public Resources getResources() {
         return mRes == null ? super.getResources() : mRes;
     }
@@ -23,4 +31,8 @@ public class XWalkRuntimeApplication extends Application {
         if (mRes != null) return;
         mRes = new XWalkMixedResources(super.getResources(), res);
     }
+
+    static XWalkApplication getApplication() {
+        return gApp;
+    }
 }