WMSApplication.java
969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.huaheng.mobilewms;
import android.app.Application;
import android.content.Context;
import com.huaheng.mobilewms.util.CrashHandler;
import org.xutils.x;
public class WMSApplication extends Application {
private static Context mContext;
private static WMSApplication instance;
private static String cookie;
@Override
public void onCreate() {
super.onCreate();
mContext = this;
initData();
}
public static WMSApplication getInstance() {
if(instance == null) {
instance = new WMSApplication();
}
return instance;
}
public void initData() {
mContext = this;
CrashHandler.getInstance().init(this);
}
public static Context getContext() {
return mContext;
}
public static String getOkhttpCookie() {
return cookie;
}
public static void setOkhttpCookie(String result) {
cookie = result;
}
}