-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 修复在拍摄界面中的横向图片列表中,快速连续(300毫秒以内)的删除多个图片会导致闪退问题
- Loading branch information
1 parent
20586e1
commit f400277
Showing
7 changed files
with
162 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
app/src/main/java/com/zhongjh/cameraapp/phone/ErrorActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.zhongjh.cameraapp.phone; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.graphics.Color; | ||
import android.os.Bundle; | ||
|
||
import androidx.annotation.Nullable; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.databinding.DataBindingUtil; | ||
|
||
import com.zhongjh.cameraapp.R; | ||
import com.zhongjh.cameraapp.databinding.ActivityErrorBinding; | ||
|
||
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; | ||
import cat.ereza.customactivityoncrash.config.CaocConfig; | ||
|
||
/** | ||
* @author zhongjh | ||
* @date 2022/6/2 | ||
*/ | ||
public class ErrorActivity extends AppCompatActivity { | ||
|
||
ActivityErrorBinding mBinding; | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_error); | ||
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_error); | ||
init(); | ||
} | ||
|
||
@SuppressLint("SetTextI18n") | ||
private void init() { | ||
// 获取所有的信息 | ||
String errorDetails = CustomActivityOnCrash.getAllErrorDetailsFromIntent(this, getIntent()); | ||
// 获取堆栈跟踪信息 | ||
String stackTrace = CustomActivityOnCrash.getStackTraceFromIntent(getIntent()); | ||
// 获取错误报告的Log信息 | ||
String activityLog = CustomActivityOnCrash.getActivityLogFromIntent(getIntent()); | ||
// 获得配置信息 | ||
CaocConfig config = CustomActivityOnCrash.getConfigFromIntent(getIntent()); | ||
mBinding.tvError.setText( | ||
"【errorDetails】\n" + errorDetails + "\n\n\n【stackTrace】\n" + stackTrace + "\n\n\n【activityLog】\n" + activityLog); | ||
mBinding.tvError.setTextColor(Color.BLUE); | ||
mBinding.btnRestart.setOnClickListener(v -> CustomActivityOnCrash.restartApplication(ErrorActivity.this, config)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<LinearLayout xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context=".phone.ErrorActivity"> | ||
|
||
<androidx.core.widget.NestedScrollView | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/white"> | ||
|
||
<TextView | ||
android:id="@+id/tvError" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
</androidx.core.widget.NestedScrollView> | ||
|
||
<Button | ||
android:id="@+id/btnRestart" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:layout_marginTop="16dp" | ||
android:layout_marginBottom="16dp" | ||
android:text="重启" /> | ||
|
||
</LinearLayout> | ||
|
||
</layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters