Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions app/src/main/java/com/example/vu/android/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,19 @@ protected void onCreate(Bundle savedInstanceState) {
breadcrumb.setData("Activity Name", activity);
Sentry.addBreadcrumb( breadcrumb );

// Unhandled - ArithmeticException
// Fixed - ArithmeticException removed
Button div_by_zero_button = findViewById(R.id.div_zero);
div_by_zero_button.setOnClickListener(view -> {
addAttachment(false);
Breadcrumb bc = new Breadcrumb();
bc.setMessage("Button for ArithmeticException clicked...");
bc.setLevel(SentryLevel.ERROR);
bc.setMessage("Button clicked - ArithmeticException has been fixed");
bc.setLevel(SentryLevel.INFO);
bc.setData("url", "https://sentry.io");
Sentry.addBreadcrumb(bc);

int t = 5 / 0;
// Fixed: Replaced divide-by-zero with safe division
int t = 5 / 1;
Log.d("MainActivity", "Division result: " + t);
});

// Unhandled - NegativeArraySizeException
Expand Down
Loading