refactor: 重构崩溃处理机制与日志工具
- 优化 CrashHandler 崩溃处理逻辑,统一通知发送逻辑 - 新增 GlobalAppCrashSafetyWire 独立崩溃安全防护类 - 增强 LogUtils 日志工具,补齐异常日志重载方法 - 重构 GlobalCrashActivity 页面,提升稳定性与可读性 - 修复 activity_globalcrash.xml 布局多余符号 - 新增 CrashTestActivity 崩溃测试页面 - 更新 buildCount 编译计数
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Mon May 11 10:33:41 HKT 2026
|
||||
#Mon May 11 14:40:07 CST 2026
|
||||
stageCount=4
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.20
|
||||
publishVersion=15.20.3
|
||||
buildCount=0
|
||||
buildCount=33
|
||||
baseBetaVersion=15.20.4
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package cc.winboll.studio.appbase;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.ToastUtils;
|
||||
|
||||
public class CrashTestActivity extends Activity {
|
||||
|
||||
public static final String TAG = "CrashTestActivity";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_crash_test);
|
||||
LogUtils.d(TAG, "CrashTestActivity onCreate()");
|
||||
}
|
||||
|
||||
public void onBack(View view) {
|
||||
finish();
|
||||
}
|
||||
|
||||
public void onTestCrash(View view) {
|
||||
LogUtils.d(TAG, "onTestCrash()");
|
||||
ToastUtils.show("测试布局崩溃...");
|
||||
}
|
||||
}
|
||||
60
appbase/src/main/res/layout/activity_crash_test.xml
Normal file
60
appbase/src/main/res/layout/activity_crash_test.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="0dp"
|
||||
android:background="?attr/activityBackgroundColor">
|
||||
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/toolbarBackgroundColor"
|
||||
android:id="@+id/toolbar"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<cc.winboll.studio.appbase.UndefinedCustomView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="返回"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/activityTextColor"
|
||||
android:background="?attr/buttonBackgroundColor"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:onClick="onBack"
|
||||
android:layout_margin="10dp"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="测试崩溃"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/activityTextColor"
|
||||
android:background="?attr/buttonBackgroundColor"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:onClick="onTestCrash"
|
||||
android:layout_margin="10dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user