@Override public void onStop() { if (mCursor != null) { mCursor.close(); } ResponseHandler.unregister(mDonationsObserver); super.onStop(); }
@Override public void onActivityCreated(Bundle savedInstanceState) { mDonateDb = new DonateDatabase(getActivity()); Handler handler = new Handler(); mDonationsObserver = new DonationsObserver(handler); mBillingService = new BillingService(); mBillingService.setContext(getActivity()); super.onActivityCreated(savedInstanceState); }
@Override public void onDestroy() { super.onDestroy(); mDonateDb.close(); mBillingService.unbind(); }
@Override public void onStart() { setBackgroundTask(new DonateTask()).execute(); ResponseHandler.register(mDonationsObserver); super.onStart(); }