Browse Source

欢迎页面崩溃调试

授权码生成工具
pry 3 months ago
parent
commit
7407215816
3 changed files with 28 additions and 10 deletions
  1. +1
    -1
      app/src/main/java/com/bonait/bnframework/business/MainInit.java
  2. +23
    -7
      app/src/main/java/com/bonait/bnframework/modules/welcome/activity/WelcomeActivity.java
  3. +4
    -2
      app/src/main/res/layout/activity_welcome.xml

+ 1
- 1
app/src/main/java/com/bonait/bnframework/business/MainInit.java View File

@@ -77,7 +77,7 @@ public class MainInit {
public static void Init(Application app) public static void Init(Application app)
{ {
//0.全局异常捕获,保存为SD卡本级目录 crash //0.全局异常捕获,保存为SD卡本级目录 crash
CrashHandler.getInstance().init(app);
// CrashHandler.getInstance().init(app);


//1.设置程序active,初始化Main函数进程,初始化消息日志 //1.设置程序active,初始化Main函数进程,初始化消息日志
InitMsgLog(); InitMsgLog();


+ 23
- 7
app/src/main/java/com/bonait/bnframework/modules/welcome/activity/WelcomeActivity.java View File

@@ -11,13 +11,16 @@ import androidx.recyclerview.widget.GridLayoutManager;


import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent;


import com.apkfuns.logutils.LogUtils; import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.MainApplication;
import com.bonait.bnframework.R; import com.bonait.bnframework.R;
import com.bonait.bnframework.business.MainInit; import com.bonait.bnframework.business.MainInit;
import com.bonait.bnframework.common.base.BaseActivity; import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.ConfigName; import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.Constants; import com.bonait.bnframework.common.constant.Constants;
import com.bonait.bnframework.common.helper.CrashHandler;
import com.bonait.bnframework.common.utils.ScreenUtils; import com.bonait.bnframework.common.utils.ScreenUtils;
import com.bonait.bnframework.manager.ActivityLifecycleManager; import com.bonait.bnframework.manager.ActivityLifecycleManager;
import com.bonait.bnframework.modules.home.activity.BottomNavigation2Activity; import com.bonait.bnframework.modules.home.activity.BottomNavigation2Activity;
@@ -40,11 +43,18 @@ public class WelcomeActivity extends BaseActivity {
private final static int SELECT_MODE = 2; private final static int SELECT_MODE = 2;
private OkHttpClient.Builder builder; private OkHttpClient.Builder builder;


@Override
public boolean onTouchEvent(MotionEvent event) {
return true;
// return super.onTouchEvent(event);
}


@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome); setContentView(R.layout.activity_welcome);

CrashHandler.getInstance().init(MainApplication.getContext());
DisplayMetrics dm = new DisplayMetrics(); DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm); getWindowManager().getDefaultDisplay().getMetrics(dm);
int miDisplayWidth = dm.widthPixels; int miDisplayWidth = dm.widthPixels;
@@ -110,8 +120,13 @@ public class WelcomeActivity extends BaseActivity {
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
//判断token
doPost();
try{
//判断token
doPost();
}catch (Exception e){

}

} }
}, 2000); }, 2000);
} }
@@ -242,10 +257,11 @@ public class WelcomeActivity extends BaseActivity {
*/ */
@Override @Override
public boolean onKeyDown(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
return true;
}
return super.onKeyDown(keyCode, event);
return true;
// if (keyCode == KeyEvent.KEYCODE_BACK) {
// return true;
// }
// return super.onKeyDown(keyCode, event);
} }


@Override @Override


+ 4
- 2
app/src/main/res/layout/activity_welcome.xml View File

@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:focusable="false"
android:focusableInTouchMode="false"
tools:context=".modules.welcome.activity.WelcomeActivity"> tools:context=".modules.welcome.activity.WelcomeActivity">


<RelativeLayout <RelativeLayout
@@ -38,4 +40,4 @@


</RelativeLayout> </RelativeLayout>


</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>
</RelativeLayout>

Loading…
Cancel
Save