finish before presentation

This commit is contained in:
mikgaw@st.amu.edu.pl 2023-12-06 00:10:20 +01:00
parent ad9b2aa6a9
commit 0fdff62ef2

View File

@ -4,6 +4,7 @@ import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
@ -58,7 +59,7 @@ public class MainActivity extends AppCompatActivity {
try { try {
loadNotesFromPreferencesToList(); loadNotesFromPreferencesToList();
} catch (GeneralSecurityException e) { } catch (GeneralSecurityException e) {
throw new RuntimeException(e); Log.e("From MainActivity", "Error : Caused by loadNotesFromPreferencesToList" + e.getMessage(), e);
} }
displayNotes(); displayNotes();
@ -120,7 +121,7 @@ public class MainActivity extends AppCompatActivity {
try { try {
updatePassword(hashedEmail, newPassword); updatePassword(hashedEmail, newPassword);
} catch (GeneralSecurityException e) { } catch (GeneralSecurityException e) {
throw new RuntimeException(e); Log.e("From MainActivity", "Error : Caused by updatePassword" + e.getMessage(), e);
} }
} else { } else {
Toast.makeText(MainActivity.this, "New passwords don't match!", Toast.LENGTH_SHORT).show(); Toast.makeText(MainActivity.this, "New passwords don't match!", Toast.LENGTH_SHORT).show();
@ -158,7 +159,7 @@ public class MainActivity extends AppCompatActivity {
try { try {
saveNotesToPreferences("add"); saveNotesToPreferences("add");
} catch (GeneralSecurityException e) { } catch (GeneralSecurityException e) {
throw new RuntimeException(e); Log.e("From MainActivity", "Error : Caused by saveNotesToPreferences" + e.getMessage(), e);
} }
createNoteView(note); createNoteView(note);
@ -194,7 +195,7 @@ public class MainActivity extends AppCompatActivity {
try { try {
deleteNoteAndRefresh(note); deleteNoteAndRefresh(note);
} catch (GeneralSecurityException e) { } catch (GeneralSecurityException e) {
throw new RuntimeException(e); Log.e("From MainActivity", "Error : Caused by deleteNoteAndRefresh" + e.getMessage(), e);
} }
note.setTitle(title); note.setTitle(title);
@ -205,7 +206,7 @@ public class MainActivity extends AppCompatActivity {
try { try {
saveNotesToPreferences("add"); saveNotesToPreferences("add");
} catch (GeneralSecurityException e) { } catch (GeneralSecurityException e) {
throw new RuntimeException(e); Log.e("From MainActivity", "Error : Caused by saveNotesToPreferences" + e.getMessage(), e);
} }
createNoteView(note); createNoteView(note);
}else { }else {
@ -229,7 +230,7 @@ public class MainActivity extends AppCompatActivity {
try { try {
deleteNoteAndRefresh(note); deleteNoteAndRefresh(note);
} catch (GeneralSecurityException e) { } catch (GeneralSecurityException e) {
throw new RuntimeException(e); Log.e("From MainActivity", "Error : Caused by deleteNoteAndRefresh" + e.getMessage(), e);
} }
}); });
builder.setNegativeButton("Cancel", null); builder.setNegativeButton("Cancel", null);