public class

MapScreen

extends MapActivity
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
         ↳ android.app.Activity
           ↳ com.google.android.maps.MapActivity
             ↳ sofia.maps.MapScreen

Class Overview

Due to implementation details in the Android library, MapScreen cannot actually extend the Screen class. It does, however, support all the same helper methods that Screen supports. TODO make sure this class is in-sync with Screen

Summary

[Expand]
Inherited Constants
From class android.app.Activity
From class android.content.Context
[Expand]
Inherited Fields
From class android.app.Activity
Public Constructors
MapScreen()
Initializes a new MapScreen object.
Public Methods
void addContentView(View view, ViewGroup.LayoutParams layout)
void finish(Object result)
Call this method when the current screen is finished and should be closed.
LayoutInflater getLayoutInflater()
ScreenMixin getScreenMixin()
Not intended to be called by users; this method is public as an implementation detail.
Object getSystemService(String service)
void log(String message)
Prints an informational message to the system log, tagged with the "User Log" tag so that it can be easily identified in the LogCat view.
boolean onCreateOptionsMenu(Menu menu)
boolean onOptionsItemSelected(MenuItem item)
void presentActivity(Intent intent, String returnMethod)
Starts the activity with the specified intent.
void presentScreen(Class<? extends Screen> screenClass, Object... args)
Starts the activity represented by the specified Screen subclass and slides it into view.
void setContentView(View view)
void setContentView(int layoutResID)
void setContentView(View view, ViewGroup.LayoutParams layout)
void showAlertDialog(String title, String message)
Displays an alert dialog and waits for the user to dismiss it.
boolean showConfirmationDialog(String title, String message)
Displays a confirmation dialog and waits for the user to select an option.
Protected Methods
void afterInitialize()
Called once the screen has been created and made visible.
void afterLayoutInflated(boolean inflated)
This method is called after an attempted was made to inflate the screen's layout.
void beforeInitialize()
Called before #initialize() during the screen creation process.
MapView getMapView()
boolean isRouteDisplayed()
String mapsApiKey()

By default, this method returns the String resource with the ID google_maps_api_key, which acts as a convenient place for developers to stash this key.

void onActivityResult(int requestCode, int resultCode, Intent data)
Called when a sub-activity returns yielding a result.
void onCreate(Bundle savedInstanceState)
Called when the activity is created.
void onDestroy()
void onPause()
void onResume()
void onSaveInstanceState(Bundle bundle)
void onStop()
[Expand]
Inherited Methods
From class com.google.android.maps.MapActivity
From class android.app.Activity
From class android.view.ContextThemeWrapper
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.view.KeyEvent.Callback
From interface android.view.LayoutInflater.Factory
From interface android.view.View.OnCreateContextMenuListener
From interface android.view.Window.Callback

Public Constructors

public MapScreen ()

Initializes a new MapScreen object.

Public Methods

public void addContentView (View view, ViewGroup.LayoutParams layout)

public void finish (Object result)

Call this method when the current screen is finished and should be closed. The specified value will be passed back to the previous screen and returned from the #presentScreen(Class, Object...) call that originally presented this screen.

Parameters
result the value to pass back to the previous screen

public LayoutInflater getLayoutInflater ()

public ScreenMixin getScreenMixin ()

Not intended to be called by users; this method is public as an implementation detail.

public Object getSystemService (String service)

public void log (String message)

Prints an informational message to the system log, tagged with the "User Log" tag so that it can be easily identified in the LogCat view.

Parameters
message the message to log

public boolean onCreateOptionsMenu (Menu menu)

public boolean onOptionsItemSelected (MenuItem item)

public void presentActivity (Intent intent, String returnMethod)

Starts the activity with the specified intent. This method will not return until the new activity is dismissed by the user.

Parameters
intent an Intent that describes the activity to start
returnMethod the name of the method to call when the activity returns

public void presentScreen (Class<? extends Screen> screenClass, Object... args)

Starts the activity represented by the specified Screen subclass and slides it into view. This method will not return until the new screen is dismissed by the user.

Parameters
screenClass the subclass of Screen that will be displayed
args the arguments to be sent to the screen's initialize method

public void setContentView (View view)

public void setContentView (int layoutResID)

public void setContentView (View view, ViewGroup.LayoutParams layout)

public void showAlertDialog (String title, String message)

Displays an alert dialog and waits for the user to dismiss it.

Parameters
title the title to display in the dialog
message the message to display in the dialog

public boolean showConfirmationDialog (String title, String message)

Displays a confirmation dialog and waits for the user to select an option.

Parameters
title the title to display in the dialog
message the message to display in the dialog
Returns
  • true if the user clicked the "Yes" option; false if the user clicked the "No" option or cancelled the dialog (for example, by pressing the Back button)

Protected Methods

protected void afterInitialize ()

Called once the screen has been created and made visible.

protected void afterLayoutInflated (boolean inflated)

This method is called after an attempted was made to inflate the screen's layout. Most users will not need to call or override this method; it is provided for Sofia's own subclasses of Screen to support custom behavior depending on whether a user layout was provided or not.

Returns
  • true if a layout was found and inflated, otherwise false

protected void beforeInitialize ()

Called before #initialize() during the screen creation process. Most users typically will not need to override this method; it is intended for Sofia's own subclasses of Screen so that users can override #initialize() without being required to call the superclass implementation.

protected MapView getMapView ()

protected boolean isRouteDisplayed ()

protected String mapsApiKey ()

By default, this method returns the String resource with the ID google_maps_api_key, which acts as a convenient place for developers to stash this key.

If desired, users who subclass MapScreen can also override this method and return their Google Maps API key instead.

Returns
  • the user's Google Maps API key

protected void onActivityResult (int requestCode, int resultCode, Intent data)

Called when a sub-activity returns yielding a result. Subclasses that override this method must call the superclass implementation in order to make sure that built-in methods like #selectImageFromGallery() work correctly.

protected void onCreate (Bundle savedInstanceState)

Called when the activity is created.

Parameters
savedInstanceState instance data previously saved by this activity

protected void onDestroy ()

protected void onPause ()

protected void onResume ()

protected void onSaveInstanceState (Bundle bundle)

protected void onStop ()