From 51d96188bdff1a6c670ff87a4fdc2bc076626a93 Mon Sep 17 00:00:00 2001 From: Aditi Vakeel Date: Sat, 3 Dec 2022 23:50:15 -0500 Subject: [PATCH] updated varible in limitactivity --- app/src/main/java/com/xa/xpensauditor/SetLimitActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/xa/xpensauditor/SetLimitActivity.java b/app/src/main/java/com/xa/xpensauditor/SetLimitActivity.java index 4849ae54..e83fdad1 100644 --- a/app/src/main/java/com/xa/xpensauditor/SetLimitActivity.java +++ b/app/src/main/java/com/xa/xpensauditor/SetLimitActivity.java @@ -148,14 +148,14 @@ public void onClick(View view) { public void onDataChange(@NonNull DataSnapshot snapshot) { for (DataSnapshot snapshot3 : snapshot.getChildren()) { if (Integer.parseInt(snapshot3.child("Day").getValue().toString()) == (thisDay)) { - String amm = (snapshot3.child("Amount").getValue()).toString(); + String amm = (snapshot3.child("Amount").getValue().toString()); int am1 = Integer.parseInt(amm); day_tol = am1 + day_tol; } } System.out.println("Day-total " + day_tol); - if (dt > Integer.parseInt(sharedPreferences.getString(DLIMIT,"0"))){ + if (day_tol > Integer.parseInt(sharedPreferences.getString(DLIMIT,"0"))){ System.out.println("Day limit crossed"); //Toast.makeText(activity, "TODO - SEND EMAIL TO THE USER AS DAILY SET LIMIT IS EXCEEDED ", Toast.LENGTH_SHORT).show(); new LimitEmailSender("You have exceeded the limit set for the day.Happy spending!", FirebaseAuth.getInstance().getCurrentUser().getEmail()).execute();