get requests on Earn

This commit is contained in:
Nicolás Sánchez 2025-03-12 10:41:14 -03:00
parent 2e4b0ec0a6
commit 958ed62b45
1 changed files with 6 additions and 2 deletions

View File

@ -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());