org.solovyev.android.ads
Class AbstractAdFreePreferenceActivity

java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.view.ContextThemeWrapper
              extended by android.app.Activity
                  extended by android.app.ListActivity
                      extended by android.preference.PreferenceActivity
                          extended by org.solovyev.android.ads.AbstractAdFreePreferenceActivity
All Implemented Interfaces:
android.content.ComponentCallbacks, android.content.ComponentCallbacks2, android.preference.PreferenceFragment.OnPreferenceStartFragmentCallback, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory, android.view.LayoutInflater.Factory2, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback, IBillingObserver

public abstract class AbstractAdFreePreferenceActivity
extends android.preference.PreferenceActivity
implements IBillingObserver

User: serso Date: 4/18/12 Time: 12:14 AM


Nested Class Summary
 
Nested classes/interfaces inherited from class android.preference.PreferenceActivity
android.preference.PreferenceActivity.Header
 
Field Summary
 
Fields inherited from class android.preference.PreferenceActivity
EXTRA_NO_HEADERS, EXTRA_SHOW_FRAGMENT, EXTRA_SHOW_FRAGMENT_ARGUMENTS, EXTRA_SHOW_FRAGMENT_SHORT_TITLE, EXTRA_SHOW_FRAGMENT_TITLE, HEADER_ID_UNDEFINED
 
Fields inherited from class android.app.Activity
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Fields inherited from interface android.content.ComponentCallbacks2
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
 
Constructor Summary
AbstractAdFreePreferenceActivity()
           
 
Method Summary
protected abstract  String getAdFreePreferenceId()
           
protected abstract  String getAdFreeProductId()
           
protected abstract  String getClearBillingDataPreferenceId()
           
protected abstract  int getPreferencesResourceId()
           
 void onCheckBillingSupportedResponse(boolean supported)
          Called each time
protected  void onCreate(android.os.Bundle savedInstanceState)
           
protected  void onDestroy()
           
 void onErrorRestoreTransactions(ResponseCode responseCode)
          Called when a restore transactions request ended with a server error.
 void onPurchaseIntentFailure(String productId, ResponseCode responseCode)
          Called when purchase intent was not sent due to billing service error
 void onPurchaseIntentOK(String productId, android.app.PendingIntent purchaseIntent)
          Called after requesting the purchase of the specified item.
 void onPurchaseStateChanged(String itemId, Transaction.PurchaseState state)
          Called when the specified item is purchased, cancelled or refunded.
 void onRequestPurchaseResponse(String itemId, ResponseCode response)
          Called with the response for the purchase request of the specified item.
 void onTransactionsRestored()
          Called when a restore transactions request has been successfully received by the server.
static void removeBillingInformation(android.content.Context context, android.content.SharedPreferences preferences)
           
 
Methods inherited from class android.preference.PreferenceActivity
addPreferencesFromIntent, addPreferencesFromResource, findPreference, finishPreferencePanel, getPreferenceManager, getPreferenceScreen, hasHeaders, invalidateHeaders, isMultiPane, loadHeadersFromResource, onActivityResult, onBuildHeaders, onBuildStartFragmentIntent, onContentChanged, onGetInitialHeader, onGetNewHeader, onHeaderClick, onIsHidingHeaders, onIsMultiPane, onListItemClick, onNewIntent, onPreferenceStartFragment, onPreferenceTreeClick, onRestoreInstanceState, onSaveInstanceState, onStop, setListFooter, setParentTitle, setPreferenceScreen, showBreadCrumbs, startPreferenceFragment, startPreferencePanel, startWithFragment, startWithFragment, switchToHeader, switchToHeader
 
Methods inherited from class android.app.ListActivity
getListAdapter, getListView, getSelectedItemId, getSelectedItemPosition, setListAdapter, setSelection
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMenuInflater, getParent, getParentActivityIntent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isChangingConfigurations, isChild, isFinishing, isTaskRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onCreateView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNavigateUp, onNavigateUpFromChild, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onRestart, onResume, onRetainNonConfigurationInstance, onSearchRequested, onStart, onTitleChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, recreate, registerForContextMenu, removeDialog, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setIntent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, shouldUpRecreateTask, showDialog, showDialog, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityForResult, startActivityForResult, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
 
Methods inherited from class android.view.ContextThemeWrapper
attachBaseContext, getTheme, setTheme
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalFilesDir, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAdFreePreferenceActivity

public AbstractAdFreePreferenceActivity()
Method Detail

onCreate

protected void onCreate(android.os.Bundle savedInstanceState)
Overrides:
onCreate in class android.preference.PreferenceActivity

getPreferencesResourceId

protected abstract int getPreferencesResourceId()

getClearBillingDataPreferenceId

@Nullable
protected abstract String getClearBillingDataPreferenceId()

getAdFreeProductId

@Nonnull
protected abstract String getAdFreeProductId()

getAdFreePreferenceId

@Nonnull
protected abstract String getAdFreePreferenceId()

removeBillingInformation

public static void removeBillingInformation(@Nonnull
                                            android.content.Context context,
                                            @Nonnull
                                            android.content.SharedPreferences preferences)

onDestroy

protected void onDestroy()
Overrides:
onDestroy in class android.preference.PreferenceActivity

onCheckBillingSupportedResponse

public void onCheckBillingSupportedResponse(boolean supported)
Description copied from interface: IBillingObserver
Called each time

Specified by:
onCheckBillingSupportedResponse in interface IBillingObserver
Parameters:
supported - if true, in-app billing is supported. Otherwise, it isn't.
See Also:
BillingController.checkBillingSupported(android.content.Context)

onPurchaseIntentOK

public void onPurchaseIntentOK(@Nonnull
                               String productId,
                               @Nonnull
                               android.app.PendingIntent purchaseIntent)
Description copied from interface: IBillingObserver
Called after requesting the purchase of the specified item.

Specified by:
onPurchaseIntentOK in interface IBillingObserver
Parameters:
productId - id of the item whose purchase was requested.
purchaseIntent - a purchase pending intent for the specified item.
See Also:
BillingController.requestPurchase(android.content.Context, String, boolean)

onPurchaseIntentFailure

public void onPurchaseIntentFailure(@Nonnull
                                    String productId,
                                    @Nonnull
                                    ResponseCode responseCode)
Description copied from interface: IBillingObserver
Called when purchase intent was not sent due to billing service error

Specified by:
onPurchaseIntentFailure in interface IBillingObserver
Parameters:
productId - id of the item whose purchase was requested
responseCode - one of the failures response codes from billing service

onPurchaseStateChanged

public void onPurchaseStateChanged(@Nonnull
                                   String itemId,
                                   @Nonnull
                                   Transaction.PurchaseState state)
Description copied from interface: IBillingObserver
Called when the specified item is purchased, cancelled or refunded.

Specified by:
onPurchaseStateChanged in interface IBillingObserver
Parameters:
itemId - id of the item whose purchase state has changed.
state - purchase state of the specified item.

onRequestPurchaseResponse

public void onRequestPurchaseResponse(@Nonnull
                                      String itemId,
                                      @Nonnull
                                      ResponseCode response)
Description copied from interface: IBillingObserver
Called with the response for the purchase request of the specified item. This is used for reporting various errors, or if the user backed out and didn't purchase the item.

Specified by:
onRequestPurchaseResponse in interface IBillingObserver
Parameters:
itemId - id of the item whose purchase was requested
response - response of the purchase request

onTransactionsRestored

public void onTransactionsRestored()
Description copied from interface: IBillingObserver
Called when a restore transactions request has been successfully received by the server.

Specified by:
onTransactionsRestored in interface IBillingObserver

onErrorRestoreTransactions

public void onErrorRestoreTransactions(@Nonnull
                                       ResponseCode responseCode)
Description copied from interface: IBillingObserver
Called when a restore transactions request ended with a server error.

Specified by:
onErrorRestoreTransactions in interface IBillingObserver
Parameters:
responseCode - response code


Copyright © 2013. All Rights Reserved.