net.rim.blackberry.api.cradle
Class CradleHandlerRegistry

java.lang.Object
  extended by net.rim.blackberry.api.cradle.CradleHandlerRegistry

public class CradleHandlerRegistry
extends Object

Registry for cradle handlers. A cradle handler is an application that is a candidate to be started when a cradle of the corresponding type is connected.

If any handlers are registered for a cradle type, the device user will be presented with a selection dialog when such a cradle is connected. The user can select which handler to use, if any. The selected handler application will then be started. Also, the selected handler application will be automatically started the next time the cradle of the specified type is connected if the user indicated in the selection dialog to take the same action in the future.

Since:
BlackBerry API 6.0.0

Method Summary
static void registerHandler(int cradleType, ApplicationDescriptor handler)
          Registers a handler for a given cradle type.
static void unregisterHandler(int cradleType, ApplicationDescriptor handler)
          Unregisters a cradle handler.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

registerHandler

public static void registerHandler(int cradleType,
                                   ApplicationDescriptor handler)
                            throws UnsupportedOperationException,
                                   IllegalArgumentException
Registers a handler for a given cradle type.

Parameters:
cradleType - Type of the cradle. One of the TYPE_ constants in CradleProtocol.
handler - Application that is a candidate to be started when a cradle of type cradleType is connected.
Throws:
IllegalArgumentException - if cradle type is equal to CradleProtocol.TYPE_NONE
UnsupportedOperationException - if cradle connection can't be detected on this device
Since:
BlackBerry API 6.0.0

unregisterHandler

public static void unregisterHandler(int cradleType,
                                     ApplicationDescriptor handler)
                              throws IllegalArgumentException
Unregisters a cradle handler.

Parameters:
cradleType - Type of the cradle. One of the TYPE_ constants in CradleProtocol.
handler - Application that was previously registered through CradleHandlerRegistry.registerHandler(int, ApplicationDescriptor).
Throws:
IllegalArgumentException - if cradle type is equal to CradleProtocol.TYPE_NONE
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.