From 958ed62b45d7d6967673b45d392132c643af5ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20S=C3=A1nchez?= Date: Wed, 12 Mar 2025 10:41:14 -0300 Subject: [PATCH] get requests on Earn --- .../main/java/com/example/dcav2gui/EarnerInterface.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/dcav2gui/EarnerInterface.java b/app/src/main/java/com/example/dcav2gui/EarnerInterface.java index 1ec80e9..9770905 100644 --- a/app/src/main/java/com/example/dcav2gui/EarnerInterface.java +++ b/app/src/main/java/com/example/dcav2gui/EarnerInterface.java @@ -86,7 +86,9 @@ public class EarnerInterface { new Thread(() -> { try { JsonObject result = getLastSubscription(exchange, true); - new Handler(Looper.getMainLooper()).post(() -> showJsonDialog(result, context)); + String dialogTitle = "Last subscription"; + String dialogMessage = result.get("last_subscription").toString(); + new Handler(Looper.getMainLooper()).post(() -> showSimpleDialog(dialogTitle, dialogMessage, context)); } catch (IOException e) { e.printStackTrace(); new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(context, "Failed to get last subscription", Toast.LENGTH_SHORT).show()); @@ -98,7 +100,9 @@ public class EarnerInterface { new Thread(() -> { try { JsonObject result = getLastRedemption(exchange, true); - new Handler(Looper.getMainLooper()).post(() -> showJsonDialog(result, context)); + String dialogTitle = "Last redemption"; + String dialogMessage = result.get("last_redemption").toString(); + new Handler(Looper.getMainLooper()).post(() -> showSimpleDialog(dialogTitle, dialogMessage, context)); } catch (IOException e) { e.printStackTrace(); new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(context, "Failed to get last redemption", Toast.LENGTH_SHORT).show());