version:1.7.0
fix: update:修改布局
This commit is contained in:
@@ -3,6 +3,7 @@ package com.uiui.zyos.base;
|
||||
import android.app.Application;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Debug;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
@@ -30,28 +31,30 @@ public class BaseApplication extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e(TAG, "onCreate: ");
|
||||
if (!BuildConfig.DEBUG) {
|
||||
// catchException();
|
||||
}
|
||||
// 在开始分析的地方调用,传入路径
|
||||
// 如果是放到外部路径,需要添加权限
|
||||
// 默认存储在/sdcard/Android/data/packagename/files
|
||||
// Debug.startMethodTracing("App" + System.currentTimeMillis());
|
||||
init();
|
||||
// 在结束的地方调用
|
||||
// Debug.stopMethodTracing();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
Log.e(TAG, "init: ");
|
||||
if (BuildConfig.DEBUG) {
|
||||
|
||||
}
|
||||
if (SystemUtils.isMainProcessName(this, android.os.Process.myPid())) {
|
||||
String rootDir = MMKV.initialize(this);
|
||||
Log.e(TAG, "mmkv root: " + rootDir);
|
||||
|
||||
CrashReport.initCrashReport(getApplicationContext(), "d1cd982951", false);
|
||||
|
||||
AppManager.init(this);
|
||||
Aria.init(this);
|
||||
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
|
||||
Aria.get(this).getDownloadConfig().setConvertSpeed(true);
|
||||
PushManager.init(this);
|
||||
aliyunPushInit();
|
||||
|
||||
RemoteManager.init(this);
|
||||
RemoteManager.setListener(new RemoteManager.ConnectedListener() {
|
||||
@Override
|
||||
@@ -66,22 +69,22 @@ public class BaseApplication extends Application {
|
||||
NetInterfaceManager.init(this);
|
||||
// startService(new Intent(this, MainService.class));
|
||||
registAppReceive();
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
slowInit();
|
||||
}
|
||||
}, 1234);
|
||||
}
|
||||
}
|
||||
|
||||
private APKinstallReceiver apKinstallReceiver;
|
||||
|
||||
private void registAppReceive() {
|
||||
if (null == apKinstallReceiver) {
|
||||
apKinstallReceiver = new APKinstallReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_ADDED);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
|
||||
filter.addDataScheme("package");
|
||||
registerReceiver(apKinstallReceiver, filter);
|
||||
private void slowInit() {
|
||||
Log.e(TAG, "slowInit: ");
|
||||
Aria.init(this);
|
||||
// Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
|
||||
// Aria.get(this).getDownloadConfig().setConvertSpeed(true);
|
||||
aliyunPushInit();
|
||||
CrashReport.initCrashReport(getApplicationContext(), "d1cd982951", false);
|
||||
}
|
||||
|
||||
public void aliyunPushInit() {
|
||||
@@ -102,16 +105,29 @@ public class BaseApplication extends Application {
|
||||
// });
|
||||
}
|
||||
|
||||
private APKinstallReceiver apKinstallReceiver;
|
||||
|
||||
private void registAppReceive() {
|
||||
if (null == apKinstallReceiver) {
|
||||
apKinstallReceiver = new APKinstallReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_ADDED);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
|
||||
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
|
||||
filter.addDataScheme("package");
|
||||
registerReceiver(apKinstallReceiver, filter);
|
||||
}
|
||||
|
||||
|
||||
private void catchException() {
|
||||
Thread.setDefaultUncaughtExceptionHandler(
|
||||
new Thread.UncaughtExceptionHandler() {
|
||||
@Override
|
||||
public void uncaughtException(Thread t, Throwable e) {
|
||||
Log.e("捕获异常子线程:", Thread.currentThread().getName() +
|
||||
"在:" + e.getStackTrace()[0].getClassName());
|
||||
}
|
||||
}
|
||||
);
|
||||
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
|
||||
@Override
|
||||
public void uncaughtException(Thread t, Throwable e) {
|
||||
Log.e("捕获异常子线程:", Thread.currentThread().getName() + "在:" + e.getStackTrace()[0].getClassName());
|
||||
}
|
||||
});
|
||||
//下面是新增方法!
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user