1
- /*
2
- * Warning: this file may be auto-generated in future. Edit with caution.
3
- */
4
1
package com .tns ;
5
2
6
3
import android .app .Application ;
7
4
8
5
@ JavaScriptImplementation (javaScriptFile = "app/MyApp.js" )
9
- public class NativeScriptApplication extends android .app .Application implements com .tns .NativeScriptHashCodeProvider
10
- {
11
- public NativeScriptApplication ()
12
- {
13
- }
14
-
15
- protected void attachBaseContext (android .content .Context param_0 ) {
16
- super .attachBaseContext (param_0 );
17
-
18
- if (Util .isDebuggableApp (param_0 ))
19
- {
20
- // TODO:
21
- //android.os.Debug.waitForDebugger();
22
- }
23
-
6
+ public class NativeScriptApplication extends android .app .Application implements com .tns .NativeScriptHashCodeProvider {
7
+
8
+ private static NativeScriptApplication thiz ;
9
+
10
+ public NativeScriptApplication ()
11
+ {
12
+ thiz = this ;
13
+ }
14
+
15
+ public void onCreate () {
24
16
new RuntimeHelper (this ).initRuntime ();
25
-
26
- Platform .initInstance (this );
27
- }
28
-
29
- public void onCreate ()
30
- {
31
- appInstance = this ;
32
- java .lang .Object [] params = null ;
33
- com .tns .Platform .callJSMethod (this , "onCreate" , void .class , params );
34
- }
35
-
36
- private static Application appInstance ;
37
- public static Application getInstance (){
38
- return appInstance ;
39
- }
40
-
41
- public boolean equals__super (java .lang .Object other ) {
42
- return super .equals (other );
43
- }
44
- public int hashCode__super () {
45
- return super .hashCode ();
46
- }
47
- }
17
+ if (Platform .isInitialized ()) {
18
+ java .lang .Object [] params = null ;
19
+ com .tns .Platform .callJSMethod (this , "onCreate" , void .class , params );
20
+ } else {
21
+ super .onCreate ();
22
+ }
23
+ }
24
+
25
+ public void onLowMemory () {
26
+ if (Platform .isInitialized ()) {
27
+ java .lang .Object [] params = null ;
28
+ com .tns .Platform .callJSMethod (this , "onLowMemory" , void .class , params );
29
+ } else {
30
+ super .onLowMemory ();
31
+ }
32
+ }
33
+
34
+ public void onTrimMemory (int level ) {
35
+ if (Platform .isInitialized ()) {
36
+ java .lang .Object [] params = new Object [1 ];
37
+ params [0 ] = level ;
38
+ com .tns .Platform .callJSMethod (this , "onTrimMemory" , void .class , params );
39
+ } else {
40
+ super .onTrimMemory (level );
41
+ }
42
+ }
43
+
44
+ public boolean equals__super (java .lang .Object other ) {
45
+ return super .equals (other );
46
+ }
47
+
48
+ public int hashCode__super () {
49
+ return super .hashCode ();
50
+ }
51
+
52
+ public static Application getInstance () {
53
+ return thiz ;
54
+ }
55
+ }
0 commit comments