com.github.droidfu.activities
Class BetterMapActivity

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 com.google.android.maps.MapActivity
                      extended by com.github.droidfu.activities.BetterMapActivity
All Implemented Interfaces:
android.content.ComponentCallbacks, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback, BetterActivity

public class BetterMapActivity
extends com.google.android.maps.MapActivity
implements BetterActivity


Field Summary
 
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_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_NOT_FOREGROUND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, 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, STORAGE_SERVICE, TELEPHONY_SERVICE, UI_MODE_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
BetterMapActivity()
           
 
Method Summary
 android.content.Intent getCurrentIntent()
          Retrieves the current intent that was used to create or resume this activity.
 com.google.android.maps.MapView getMapView()
           
 com.google.android.maps.MyLocationOverlay getMyLocationOverlay()
           
 int getWindowFeatures()
           
 boolean isApplicationBroughtToBackground()
          Android doesn't distinguish between your Activity being paused by another Activity of your own application, or by an Activity of an entirely different application.
 boolean isLandscapeMode()
           
 boolean isLaunching()
           
 boolean isPortraitMode()
           
 boolean isRestoring()
           
 boolean isResuming()
           
protected  boolean isRouteDisplayed()
           
 android.app.AlertDialog newAlertDialog(int titleResourceId, int messageResourceId)
           
 android.app.AlertDialog newErrorHandlerDialog(Exception error)
           Creates a new error dialog, with the option to either dismiss or -- if an email application is installed -- report the given error.
 android.app.AlertDialog newErrorHandlerDialog(int titleResourceId, Exception error)
           Creates a new error dialog, with the option to either dismiss or -- if an email application is installed -- report the given error.
 android.app.AlertDialog newInfoDialog(int titleResourceId, int messageResourceId)
           
<T> android.app.Dialog
newListDialog(String title, List<T> elements, DialogClickListener<T> listener, boolean closeOnSelect)
          Creates a new list style dialog from a list of objects.
 android.app.AlertDialog newYesNoDialog(int titleResourceId, int messageResourceId, android.content.DialogInterface.OnClickListener listener)
           
protected  void onCreate(android.os.Bundle icicle)
           
protected  android.app.Dialog onCreateDialog(int id)
           
 boolean onKeyDown(int keyCode, android.view.KeyEvent event)
           
 void onNewIntent(android.content.Intent intent)
           
protected  void onPause()
           
protected  void onRestoreInstanceState(android.os.Bundle savedInstanceState)
           
protected  void onResume()
           
protected  void setMapGestureListener(MapGestureListener mapGestureListener)
           
 void setMapView(int mapLayoutId)
           
 void setMapViewWithZoom(int mapLayoutId, int zoomControlsLayoutId)
           
 void setMyLocationOverlay(com.google.android.maps.MyLocationOverlay myLocationOverlay)
           
 void setProgressDialogMsgId(int progressDialogMsgId)
           
 void setProgressDialogTitleId(int progressDialogTitleId)
           
 
Methods inherited from class com.google.android.maps.MapActivity
isLocationDisplayed, onDestroy, onGetMapDataSource
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, 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, hasWindowFocus, isChild, isFinishing, isTaskRoot, managedQuery, moveTaskToBack, onActivityResult, onApplyThemeResource, onAttachedToWindow, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onDetachedFromWindow, onKeyLongPress, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareOptionsMenu, onPreparePanel, onRestart, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, overridePendingTransition, 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, setVisible, setVolumeControlStream, showDialog, showDialog, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startIntentSender, startIntentSenderForResult, startIntentSenderFromChild, startManagingCursor, 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, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, grantUriPermission, isRestricted, openFileInput, openFileOutput, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BetterMapActivity

public BetterMapActivity()
Method Detail

onCreate

protected void onCreate(android.os.Bundle icicle)
Overrides:
onCreate in class com.google.android.maps.MapActivity

onPause

protected void onPause()
Overrides:
onPause in class com.google.android.maps.MapActivity

onResume

protected void onResume()
Overrides:
onResume in class com.google.android.maps.MapActivity

onRestoreInstanceState

protected void onRestoreInstanceState(android.os.Bundle savedInstanceState)
Overrides:
onRestoreInstanceState in class android.app.Activity

onNewIntent

public void onNewIntent(android.content.Intent intent)
Overrides:
onNewIntent in class com.google.android.maps.MapActivity

isRouteDisplayed

protected boolean isRouteDisplayed()
Specified by:
isRouteDisplayed in class com.google.android.maps.MapActivity

getCurrentIntent

public android.content.Intent getCurrentIntent()
Description copied from interface: BetterActivity
Retrieves the current intent that was used to create or resume this activity. If the activity received a call to onNewIntent (e.g. because it was launched in singleTop mode), then the Intent passed to that method is returned. Otherwise the returned Intent is the intent returned by getIntent (which is the Intent which was used to initially launch this activity).

Specified by:
getCurrentIntent in interface BetterActivity
Returns:
the current Intent

getWindowFeatures

public int getWindowFeatures()
Specified by:
getWindowFeatures in interface BetterActivity

isApplicationBroughtToBackground

public boolean isApplicationBroughtToBackground()
Description copied from interface: BetterActivity
Android doesn't distinguish between your Activity being paused by another Activity of your own application, or by an Activity of an entirely different application. This function only returns true, if your Activity is being paused by an Activity of another app, thus hiding yours.

Specified by:
isApplicationBroughtToBackground in interface BetterActivity
Returns:
true, if the Activity is being paused because an Activity of another application received focus.

isLandscapeMode

public boolean isLandscapeMode()
Specified by:
isLandscapeMode in interface BetterActivity

isLaunching

public boolean isLaunching()
Specified by:
isLaunching in interface BetterActivity
Returns:
true, if the activity is launching, i.e. is going through onCreate but is not restoring.

isPortraitMode

public boolean isPortraitMode()
Specified by:
isPortraitMode in interface BetterActivity

isRestoring

public boolean isRestoring()
Specified by:
isRestoring in interface BetterActivity
Returns:
true, if the activity is recovering from in interruption (i.e. onRestoreInstanceState was called.

isResuming

public boolean isResuming()
Specified by:
isResuming in interface BetterActivity
Returns:
true, if the activity is "soft-resuming", i.e. onResume has been called without a prior call to onCreate

newYesNoDialog

public android.app.AlertDialog newYesNoDialog(int titleResourceId,
                                              int messageResourceId,
                                              android.content.DialogInterface.OnClickListener listener)
Specified by:
newYesNoDialog in interface BetterActivity

newInfoDialog

public android.app.AlertDialog newInfoDialog(int titleResourceId,
                                             int messageResourceId)
Specified by:
newInfoDialog in interface BetterActivity

newAlertDialog

public android.app.AlertDialog newAlertDialog(int titleResourceId,
                                              int messageResourceId)
Specified by:
newAlertDialog in interface BetterActivity

newErrorHandlerDialog

public android.app.AlertDialog newErrorHandlerDialog(int titleResourceId,
                                                     Exception error)
Description copied from interface: BetterActivity

Creates a new error dialog, with the option to either dismiss or -- if an email application is installed -- report the given error. Clicking the report button will cause the app to collect diagnostic information, compile it to a single text body, and launch the email application with the error report being preset as the email's body.

For this to work, you must define the following string resources in your application:

Specified by:
newErrorHandlerDialog in interface BetterActivity
Parameters:
titleResourceId - the string resource that should be used as the dialog title
error - the exception that should be displayed and/or reported
Returns:
the dialog

newErrorHandlerDialog

public android.app.AlertDialog newErrorHandlerDialog(Exception error)
Description copied from interface: BetterActivity

Creates a new error dialog, with the option to either dismiss or -- if an email application is installed -- report the given error. Clicking the report button will cause the app to collect diagnostic information, compile it to a single text body, and launch the email application with the error report being preset as the email's body.

For this to work, you must define the following string resources in your application:

Specified by:
newErrorHandlerDialog in interface BetterActivity
Parameters:
error - the exception that should be displayed and/or reported
Returns:
the dialog

newListDialog

public <T> android.app.Dialog newListDialog(String title,
                                            List<T> elements,
                                            DialogClickListener<T> listener,
                                            boolean closeOnSelect)
Description copied from interface: BetterActivity
Creates a new list style dialog from a list of objects. The toString() method of any such object will be used to generate the list item's label.

Specified by:
newListDialog in interface BetterActivity
Type Parameters:
T - the type of the list items
elements - the list items
listener - the listener used for processing list item clicks
closeOnSelect - if true, the dialog will close when an item has been clicked
Returns:
the dialog

onCreateDialog

protected android.app.Dialog onCreateDialog(int id)
Overrides:
onCreateDialog in class android.app.Activity

setProgressDialogTitleId

public void setProgressDialogTitleId(int progressDialogTitleId)
Specified by:
setProgressDialogTitleId in interface BetterActivity

setProgressDialogMsgId

public void setProgressDialogMsgId(int progressDialogMsgId)
Specified by:
setProgressDialogMsgId in interface BetterActivity

setMapView

public void setMapView(int mapLayoutId)

setMapViewWithZoom

public void setMapViewWithZoom(int mapLayoutId,
                               int zoomControlsLayoutId)

getMapView

public com.google.android.maps.MapView getMapView()

setMyLocationOverlay

public void setMyLocationOverlay(com.google.android.maps.MyLocationOverlay myLocationOverlay)

getMyLocationOverlay

public com.google.android.maps.MyLocationOverlay getMyLocationOverlay()

setMapGestureListener

protected void setMapGestureListener(MapGestureListener mapGestureListener)

onKeyDown

public boolean onKeyDown(int keyCode,
                         android.view.KeyEvent event)
Specified by:
onKeyDown in interface android.view.KeyEvent.Callback
Overrides:
onKeyDown in class android.app.Activity


Copyright © 2011. All Rights Reserved.