net.rim.device.api.system
Class SetupManager

java.lang.Object
  extended by net.rim.device.api.system.SetupManager

public class SetupManager
extends Object

A class that manages how an application can determine whether the Setup Wizard is running on the BlackBerry device.

The Setup application displays a mandatory blocking introduction, which does not allow another application to present UI prompts during the startup of a BlackBerry device. An application should ensure that this section of the Setup application is not being displayed before trying to request user input.

Typically, an application that starts when the device starts will want to register for notifications of state changes. This tells the application when the device is no longer blocked by global screens so the application can prompt the user for permissions or other information.

Registering for notifications

You can add a class that is a SetupListener to receive notifications using the SetupManager.getInstance().addListener(SetupListener) method.

To unregister this listener, you can call SetupManager.removeListener(SetupListener).

Once the SetupManager becomes aware that the Setup Wizard has completed, it will call all the registered listeners. The listeners will then be removed from the queue so that they don't need to be removed explicitly.

You can query whether the Setup Wizard is complete by calling SetupManager.getInstance().isSetupWizardDone().

Since:
BlackBerry API 7.1.0

Field Summary
static int SETUP_STATE_COMPLETE
          Indicates that the Setup Wizard is complete.
static int SETUP_STATE_IN_PROGRESS
          Indicates that the Setup Wizard is in progress.
 
Method Summary
 boolean addListener(SetupListener listener, Application app)
          Adds a listener for receiving notifications about state changes of the Setup application.
static SetupManager getInstance()
          Gets the singleton instance of the SetupManager class.
 int getSetupState()
          Gets the current state of the Setup application.
 void removeListener(SetupListener listener)
          Removes a listener for receiving notifications about state changes of the Setup application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

SETUP_STATE_IN_PROGRESS

public static final int SETUP_STATE_IN_PROGRESS
Indicates that the Setup Wizard is in progress.

See Also:
Constant Field Values
Since:
BlackBerry API 7.1.0

SETUP_STATE_COMPLETE

public static final int SETUP_STATE_COMPLETE
Indicates that the Setup Wizard is complete.

See Also:
Constant Field Values
Since:
BlackBerry API 7.1.0


Method Detail

getInstance

public static SetupManager getInstance()
Gets the singleton instance of the SetupManager class.

Returns:
The singleton instance of SetupManager.
Since:
BlackBerry API 7.1.0

getSetupState

public int getSetupState()
Gets the current state of the Setup application.

Returns:
The current state.
Since:
BlackBerry API 7.1.0

addListener

public boolean addListener(SetupListener listener,
                           Application app)
Adds a listener for receiving notifications about state changes of the Setup application.

Parameters:
listener - The SetupListener object to call back.
app - The SetupListener application to call back.
Returns:
true if the listener was added, false if the listener was not added. When returning false, the reason could be that the Setup application has already completed. Use SetupManager.getInstance().getSetupState() to determine the state.
Since:
BlackBerry API 7.1.0

removeListener

public void removeListener(SetupListener listener)
Removes a listener for receiving notifications about state changes of the Setup application.

Parameters:
listener - The SetupListener instance to remove from the list of listeners.
Since:
BlackBerry API 7.1.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal