From 4cb212e94194b60c63b5f57dd148a626224bd4a1 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Mon, 20 Aug 2012 17:27:35 -0700 Subject: [PATCH] Adjusted some parameter names for api, show toasts on ui thread --- .../astrid/actfm/sync/ActFmSyncService.java | 2 +- .../todoroo/astrid/billing/BillingActivity.java | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java index 656c4e58e..ad5e8c35b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -962,7 +962,7 @@ public final class ActFmSyncService { String purchaseToken = Preferences.getStringValue(BillingConstants.PREF_PURCHASE_TOKEN); String productId = Preferences.getStringValue(BillingConstants.PREF_PRODUCT_ID); try { - actFmInvoker.invoke("premium_update_android", "purchaseToken", purchaseToken, "productId", productId); + actFmInvoker.invoke("premium_update_android", "purchase_token", purchaseToken, "product_id", productId); Preferences.setBoolean(BillingConstants.PREF_NEEDS_SERVER_UPDATE, false); if (onSuccess != null) onSuccess.run(); diff --git a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java b/astrid/src/com/todoroo/astrid/billing/BillingActivity.java index 5aa261019..2deb72b08 100644 --- a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java +++ b/astrid/src/com/todoroo/astrid/billing/BillingActivity.java @@ -235,12 +235,22 @@ public class BillingActivity extends Activity { @Override public void run() { Preferences.setBoolean(ActFmPreferenceService.PREF_PREMIUM, true); - Toast.makeText(BillingActivity.this, R.string.premium_success, Toast.LENGTH_LONG).show(); + runOnUiThread(new Runnable() { + @Override + public void run() { + Toast.makeText(BillingActivity.this, R.string.premium_success, Toast.LENGTH_LONG).show(); + } + }); } }, new Runnable() { @Override public void run() { - Toast.makeText(BillingActivity.this, R.string.premium_success_with_server_error, Toast.LENGTH_LONG).show(); + runOnUiThread(new Runnable() { + @Override + public void run() { + Toast.makeText(BillingActivity.this, R.string.premium_success_with_server_error, Toast.LENGTH_LONG).show(); + } + }); } }); }