|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.ConvenienceKeyUtilities
public class ConvenienceKeyUtilities
A class used to programatically set an Application
as the application to be launched upon a convenience key click. This API is subject to the Device
Settings application control.
Sample usage: if(ConvenienceKeyUtilities.isKeySupported(Keypad.KEY_CONVENIENCE_1)) { String oldName = ConvenienceKeyUtilities.getConvenienceKeyAppName(Keypad.KEY_CONVENIENCE_1); ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor(ApplicationDescriptor.currentApplicationDescriptor(),"Test App",new String[] {"test arg"}); if(ConvenienceKeyUtilities.setConvenienceKeyApp(applicationDescriptor, Keypad.KEY_CONVENIENCE_1)) { System.out.println("Changed convenience key app from " + oldName + " to " + ConvenienceKeyUtilities.getConvenienceKeyAppName(Keypad.KEY_CONVENIENCE_1)); } }
Method Summary | ||
---|---|---|
|
static String |
getConvenienceKeyAppName(int key)
Returns the unique name of the module that is mapped to a convenience key |
|
static boolean |
isKeySupported(int key)
Determines whether a specified key is supported. |
|
static boolean |
setConvenienceKeyApp(ApplicationDescriptor appDescriptor,
int key)
Sets the application to launch when a specified convenience key is clicked |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean setConvenienceKeyApp(ApplicationDescriptor appDescriptor, int key) throws IllegalArgumentException
appDescriptor
- ApplicationDescriptor
for the application module to be launched by the specified convenience key.
If an ApplicationDescriptor
with more than one command line argument is provided, an IllegalArgumentException
will be thrown.
This API is subject to the Device Settings application control. Users will be prompted to allow the operation performed by this method.key
- The conveneience key to set. Should be one of Keypad.KEY_CONVENIENCE_1
or Keypad.KEY_CONVENIENCE_2
.
IllegalArgumentException
- Thrown if appDescriptor
is null
, an unsupported key is specified, or if module specified by appDescriptor
cannot be found or if an ApplicationDescriptor
containing more than one command line argument is specified.
ControlledAccessException
- Thrown if Device Settings application control prevents the requested operation.public static String getConvenienceKeyAppName(int key)
key
- The convenience key for which to retrieve the mapped module name
public static boolean isKeySupported(int key)
ConvenienceKeyUtilities.setConvenienceKeyApp(ApplicationDescriptor, int)
as key layouts may differ between device models
and software configuration may prevent the use of a given key.
key
- The key for which to check the status
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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