Simplification

pull/156/head
M66B 6 years ago
parent cf1452e5b9
commit 0b313fa9df

@ -168,7 +168,7 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
String text = getBillingResponseText(result); String text = getBillingResponseText(result);
Log.i("IAB launch billing flow response=" + text); Log.i("IAB launch billing flow response=" + text);
if (result.getResponseCode() != BillingClient.BillingResponseCode.OK) if (result.getResponseCode() != BillingClient.BillingResponseCode.OK)
Toast.makeText(ActivityBilling.this, text, Toast.LENGTH_LONG).show(); Toast.makeText(this, text, Toast.LENGTH_LONG).show();
} else } else
Helper.view(this, this, getIntentPro()); Helper.view(this, this, getIntentPro());
} }
@ -188,10 +188,10 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
.putBoolean("play_store", false) .putBoolean("play_store", false)
.apply(); .apply();
Log.i("Response valid"); Log.i("Response valid");
Toast.makeText(ActivityBilling.this, R.string.title_pro_valid, Toast.LENGTH_LONG).show(); Toast.makeText(this, R.string.title_pro_valid, Toast.LENGTH_LONG).show();
} else { } else {
Log.i("Response invalid"); Log.i("Response invalid");
Toast.makeText(ActivityBilling.this, R.string.title_pro_invalid, Toast.LENGTH_LONG).show(); Toast.makeText(this, R.string.title_pro_invalid, Toast.LENGTH_LONG).show();
} }
} catch (NoSuchAlgorithmException ex) { } catch (NoSuchAlgorithmException ex) {
Log.e(ex); Log.e(ex);
@ -242,7 +242,7 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
if (result.getResponseCode() == BillingClient.BillingResponseCode.OK) if (result.getResponseCode() == BillingClient.BillingResponseCode.OK)
checkPurchases(purchases); checkPurchases(purchases);
else else
Toast.makeText(ActivityBilling.this, text, Toast.LENGTH_LONG).show(); Toast.makeText(this, text, Toast.LENGTH_LONG).show();
} }
private void queryPurchases() { private void queryPurchases() {
@ -253,7 +253,7 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
if (result.getResponseCode() == BillingClient.BillingResponseCode.OK) if (result.getResponseCode() == BillingClient.BillingResponseCode.OK)
checkPurchases(result.getPurchasesList()); checkPurchases(result.getPurchasesList());
else else
Toast.makeText(ActivityBilling.this, text, Toast.LENGTH_LONG).show(); Toast.makeText(this, text, Toast.LENGTH_LONG).show();
} }
interface IBillingListener { interface IBillingListener {
@ -328,11 +328,11 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
} else { } else {
Log.w("Invalid signature"); Log.w("Invalid signature");
Toast.makeText(ActivityBilling.this, R.string.title_pro_invalid, Toast.LENGTH_LONG).show(); Toast.makeText(this, R.string.title_pro_invalid, Toast.LENGTH_LONG).show();
} }
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(ex);
Toast.makeText(ActivityBilling.this, Helper.formatThrowable(ex), Toast.LENGTH_LONG).show(); Toast.makeText(this, Helper.formatThrowable(ex), Toast.LENGTH_LONG).show();
} }
editor.apply(); editor.apply();

Loading…
Cancel
Save