sk.baka.ambient.activity.main
Class MainActivity

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 sk.baka.ambient.activity.main.MainActivity
All Implemented Interfaces:
ComponentCallbacks, KeyEvent.Callback, LayoutInflater.Factory, View.OnCreateContextMenuListener, Window.Callback, AppState.IAppStateAware

public class MainActivity
extends ListActivity
implements AppState.IAppStateAware

The main activity. Handles GUI operations for all GUI components.

Author:
Martin Vysny

Field Summary
static String INTENTDATA_ACTIVITY
          Send an intent with the activity enum name put under this key to activate the activity.
static String INTENTDATA_STORECONFIG
          Send an intent having this extra to save a configuration.
 
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
ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MODE_APPEND, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NOTIFICATION_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, TELEPHONY_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
MainActivity()
           
 
Method Summary
 void activateAction(ActionsEnum action, boolean cycle)
          Executes given action.
 void onCreate(Bundle icicle)
           
protected  void onDestroy()
           
protected  void onNewIntent(Intent intent)
           
 boolean onOptionsItemSelected(MenuItem item)
           
 boolean onPrepareOptionsMenu(Menu menu)
           
protected  void onStart()
           
protected  void onStop()
           
 void reinit(AppState state)
          Cherry-picks values from the application state and reinitializes itself.
 void storeState(AppState state)
          Stores the components state into the global state.
 
Methods inherited from class android.app.ListActivity
getListAdapter, getListView, getSelectedItemId, getSelectedItemPosition, onContentChanged, onListItemClick, onRestoreInstanceState, setListAdapter, setSelection
 
Methods inherited from class android.app.Activity
addContentView, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchTouchEvent, dispatchTrackballEvent, finalize, findViewById, finish, finishActivity, finishActivityFromChild, finishFromChild, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getInstanceCount, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLocalClassName, getMenuInflater, getParent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, getWindow, getWindowManager, isChild, isFinishing, isTaskRoot, managedQuery, moveTaskToBack, onActivityResult, onApplyThemeResource, onChildTitleChanged, onConfigurationChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onKeyDown, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostResume, onPrepareDialog, onPreparePanel, onRestart, onResume, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onTitleChanged, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, registerForContextMenu, removeDialog, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setIntent, setPersistent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVolumeControlStream, showDialog, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startManagingCursor, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, 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, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getFilesDir, getFileStreamPath, getMainLooper, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, grantUriPermission, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTENTDATA_ACTIVITY

public static final String INTENTDATA_ACTIVITY
Send an intent with the activity enum name put under this key to activate the activity.

See Also:
Constant Field Values

INTENTDATA_STORECONFIG

public static final String INTENTDATA_STORECONFIG
Send an intent having this extra to save a configuration.

See Also:
Constant Field Values
Constructor Detail

MainActivity

public MainActivity()
Method Detail

onCreate

public void onCreate(Bundle icicle)
Overrides:
onCreate in class Activity

onDestroy

protected void onDestroy()
Overrides:
onDestroy in class Activity

onStop

protected void onStop()
Overrides:
onStop in class Activity

onStart

protected void onStart()
Overrides:
onStart in class Activity

activateAction

public void activateAction(ActionsEnum action,
                           boolean cycle)
Executes given action.

Parameters:
action - the action to take, must not be null.
cycle - if true then random/repeat modes are cycled instead of being activated.

reinit

public void reinit(AppState state)
Description copied from interface: AppState.IAppStateAware
Cherry-picks values from the application state and reinitializes itself.

Specified by:
reinit in interface AppState.IAppStateAware
Parameters:
state - the just-loaded state

storeState

public void storeState(AppState state)
Description copied from interface: AppState.IAppStateAware
Stores the components state into the global state. Must not alter settings not applicable for this component.

Specified by:
storeState in interface AppState.IAppStateAware
Parameters:
state - the object to store to.

onNewIntent

protected void onNewIntent(Intent intent)
Overrides:
onNewIntent in class Activity

onPrepareOptionsMenu

public boolean onPrepareOptionsMenu(Menu menu)
Overrides:
onPrepareOptionsMenu in class Activity

onOptionsItemSelected

public boolean onOptionsItemSelected(MenuItem item)
Overrides:
onOptionsItemSelected in class Activity


Copyright © 2007-2008. All Rights Reserved.