2020-08-03 09:11:54 +08:00
|
|
|
package com.sl.house_property;
|
|
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
import android.app.Application;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.os.StrictMode;
|
|
|
|
|
import android.support.multidex.MultiDex;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
|
2020-08-11 14:48:10 +08:00
|
|
|
import com.lzy.ninegrid.NineGridView;
|
2020-09-07 10:05:06 +08:00
|
|
|
import com.tencent.bugly.Bugly;
|
2020-08-11 14:48:10 +08:00
|
|
|
|
2020-08-03 09:11:54 +08:00
|
|
|
import java.util.LinkedList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import tools.CrashHandler;
|
|
|
|
|
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;
|
2020-08-11 14:48:10 +08:00
|
|
|
import utils.NineImageLoader;
|
2020-08-03 09:11:54 +08:00
|
|
|
//import cn.jpush.im.android.api.JMessageClient;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by 90432 on 2018/1/15.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public class MyApplication extends Application{
|
|
|
|
|
//private static final String TAG = "JIGUANG-Example";
|
|
|
|
|
private static final String TAG = MyApplication.class.getSimpleName();
|
|
|
|
|
public static Context context;
|
|
|
|
|
protected static MyApplication instance;
|
|
|
|
|
public JCVideoPlayerStandard VideoPlaying;
|
|
|
|
|
/* private HttpNet httpNet;
|
|
|
|
|
public static Handler getTheErrorHandler;
|
|
|
|
|
public static boolean mainonce;
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
protected void attachBaseContext(Context base) {
|
|
|
|
|
super.attachBaseContext(base);
|
|
|
|
|
MultiDex.install(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static MyApplication getApp() {
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
public void existActivitys() {
|
|
|
|
|
for(Activity act :activityList){
|
|
|
|
|
act.finish();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addActivitys(Activity activity ) {
|
|
|
|
|
activityList.add(activity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Activity> activityList = new LinkedList<Activity>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onCreate() {
|
|
|
|
|
Log.d(TAG, "[ExampleApplication] onCreate");
|
|
|
|
|
super.onCreate();
|
|
|
|
|
instance = this;
|
2020-08-21 13:39:24 +08:00
|
|
|
//
|
|
|
|
|
// CrashHandler crashHandler = CrashHandler.getInstance();
|
|
|
|
|
// crashHandler.init(this);
|
2020-09-07 10:05:06 +08:00
|
|
|
Bugly.init(this,"d45325664f",false);
|
2020-12-25 15:15:11 +08:00
|
|
|
// System.setProperty("http.proxyHost", "haotian.hoheng.cn");
|
|
|
|
|
// System.setProperty("http.proxyPort", "8080");
|
2020-08-03 09:11:54 +08:00
|
|
|
|
|
|
|
|
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
|
|
|
|
|
StrictMode.setVmPolicy(builder.build());
|
2020-08-11 14:48:10 +08:00
|
|
|
NineGridView.setImageLoader(new NineImageLoader());
|
2020-08-03 09:11:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final String MESSAGE_RECEIVED_ACTION = "com.example.jpushdemo.MESSAGE_RECEIVED_ACTION";
|
|
|
|
|
public static final String KEY_MESSAGE = "message";
|
|
|
|
|
public static final String KEY_EXTRAS = "extras";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void exit() {
|
|
|
|
|
for (Activity act : activityList) {
|
|
|
|
|
act.finish();
|
|
|
|
|
}
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|