public interface

ScreenMethods

sofia.app.ScreenMethods
Known Indirect Subclasses

Class Overview

Lists the common methods that are provided by classes like Screen, MapScreen, and other "Screen-like" classes that cannot be in the same class hierarchy as Screen.

Summary

Public Methods
abstract void finish(Object result)
Call this method when the current screen is finished and should be closed.
abstract void presentActivity(Intent intent, String returnMethod)
Starts the activity with the specified intent.
abstract void presentScreen(Class<? extends Activity> screenClass, Object... args)
Starts the activity represented by the specified screen class and slides it into view.
abstract void showAlertDialog(String title, String message)
Displays an alert dialog and waits for the user to dismiss it.
abstract boolean showConfirmationDialog(String title, String message)
Displays a confirmation dialog and waits for the user to select an option.

Public Methods

public abstract 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 abstract 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 abstract void presentScreen (Class<? extends Activity> screenClass, Object... args)

Starts the activity represented by the specified screen class and slides it into view. This method returns immediately even as the screen is being presented, but at that point a new screen has taken over the user's attention and the old one might be discarded from memory at any time. Therefore, users should typically not do any important computation after calling this method.

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

public abstract 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 abstract 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)