MyApplication.java
1004 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
package com.hjx.personalcenter.activity;
import android.app.Application;
import android.content.Context;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.hjx.personalcenter.util.ImageCache;
import com.tencent.bugly.crashreport.CrashReport;
/**
* Created by ${yf} on 2017/2/16.
*/
public class MyApplication extends Application {
private ImageCache mImageCache;
private static Context context;
private static MyApplication instance;
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
//初始化Fresco
Fresco.initialize(this);
mImageCache = new ImageCache();
instance = this;
CrashReport.initCrashReport(getApplicationContext(), "c2170557a0", false);
}
public ImageCache getImageCache() {
return mImageCache;
}
public static Context getContext() {
return context;
}
public static MyApplication getInstance() {
return instance;
}
}