net.rim.device.api.system
Interface SetupListener


public interface SetupListener

A listener interface that is used to receive state change events from the Setup application on the BlackBerry device.

This listener is used to receive notifications regarding the state of the Setup application. The Setup application flow has specific parts, including a primary device setup that cannot be interrupted (Setup Wizard), and a full-screen application that can call into various panels.

At this time, there will be a notification sent to applications that add a listener for the following state changes:

Example: Implementing a setup listener

Your implementation should avoid doing any long-running work within the SetupListener event handler methods. If you do have long running work to do, then you should spin that work off onto worker threads. This example does all the work within the context of the handlers, because the operations are brief in nature:

 final class SimpleSetupHandler implements SetupListener {
 
     public SimpleSetupHandler() {
 
         //...
         // Try to add a listener to be called back when the Setup Wizard completes
         if (!SetupManager.getInstance().addListener(this, app)) {
             // If the listener was not added, maybe our parameters were right
             // but there aren't any notifications left to receive
             if (SetupManager.getInstance().getSetupState() >= SetupManager.SETUP_STATE_COMPLETE) {
                 // The blocking Setup is done, we can proceed as usual
                 //...

             } else {
                 // The listener add did not work; no notifications are expected
             }
         }
         
         // The blocking Setup Wizard is in progress
         // The app can continue with processing that does not depend on
         // presenting UI to the user
         // ...
     }
     
     public void onSetupUpdate(int update) {
         // Called when the Setup application has an update
         // ... 
         if (update == SetupManager.SETUP_STATE_COMPLETE) {
             // The UI is once again available 
         }
     }
     
     public void appTermination() {
         // Just before exiting, application should always remove listeners 
         SetupManager.getInstance().removeListener(this);
     }
 }
 

Since:
BlackBerry API 7.1.0

Method Summary
 void onSetupUpdate(int update)
          Invoked when the state of the Setup application has changed.
 



Method Detail

onSetupUpdate

void onSetupUpdate(int update)
Invoked when the state of the Setup application has changed.

Parameters:
update - The current state of the Setup application.
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