- public class MyApplication extends Application {
- private static MyApplication instance;
- public static MyApplication getInstance() {
- return instance;
- }
- @Override
- public void onCreate() {
- // TODO Auto-generated method stub
- super.onCreate();
- instance = this;
- }
- }
Manifest中添加相关Application配置
转载于:https://blog.51cto.com/gejw0623/924670