@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_static); ButterKnife.bind(this); mBuy.setOnClickListener(this); mSkus.setAdapter(new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, new String[]{"android.test.purchased", "android.test.canceled", "android.test.refunded", "android.test.item_unavailable"})); mSkus.setSelection(0); Billing.setLogger(Billing.newMainThreadLogger(new BillingLogger(mConsole))); final Billing billing = CheckoutApplication.get(this).getBilling(); mCheckout = Checkout.forActivity(this, billing); mCheckout.start(); }
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_history); ButterKnife.bind(this); final Adapter adapter = new Adapter(); mRecycler.setLayoutManager(new LinearLayoutManager(this)); mRecycler.setAdapter(adapter); final Billing billing = CheckoutApplication.get(this).getBilling(); mCheckout = Checkout.forActivity(this, billing); mCheckout.start(); mCheckout.whenReady(new HistoryLoader(adapter)); }
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_skus); ButterKnife.bind(this); final Adapter adapter = new Adapter(); mInventoryCallback = new InventoryCallback(adapter); mRecycler.setLayoutManager(new LinearLayoutManager(this)); mRecycler.setAdapter(adapter); final Billing billing = CheckoutApplication.get(this).getBilling(); mCheckout = Checkout.forActivity(this, billing); mCheckout.start(); reloadInventory(); }
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_banner); ButterKnife.bind(this); mAd.setOnClickListener(this); final Billing billing = CheckoutApplication.get(this).getBilling(); mCheckout = Checkout.forActivity(this, billing); mCheckout.start(); mCheckout.loadInventory(Inventory.Request.create().loadAllPurchases(), new InventoryCallback()); }
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_subscriptions); ButterKnife.bind(this); initAvailableSkus(); initPurchasedSkus(); initTargetSkus(); final Billing billing = CheckoutApplication.get(this).getBilling(); mCheckout = Checkout.forActivity(this, billing); mCheckout.start(); reloadInventory(); }
@Before public void setUp() throws Exception { mBilling = Tests.newBilling(); mCheckout = Checkout.forActivity(new Activity(), mBilling); }