public class OnButtonPress extends RPCNotification
Notifies application of button press events for buttons to which the application is subscribed. SDL supports two button press events defined as follows:
Parameter List:
| Name | Type | Description | Req | Notes | SmartDeviceLink Ver Available |
|---|---|---|---|---|---|
| buttonName | ButtonName | Name of the button which triggered this event | SmartDeviceLink 1.0 | ||
| buttonPressMode | ButtonPressMode | Indicates whether this is an SHORT or LONG button press event. | SmartDeviceLink 1.0 | ||
| customButtonID | Integer | If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID) | N | Minvalue=0 Maxvalue=65536 | SmartDeviceLink 2.0 |
SubscribeButton,
UnsubscribeButton| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_BUTTON_NAME |
static String |
KEY_BUTTON_PRESS_MODE |
static String |
KEY_CUSTOM_BUTTON_ID |
function, KEY_CORRELATION_ID, KEY_FUNCTION_NAME, KEY_NOTIFICATION, KEY_PARAMETERS, KEY_REQUEST, KEY_RESPONSE, messageType, parametersKEY_BULK_DATA, KEY_PROTECTED, store| Constructor and Description |
|---|
OnButtonPress()
Constructs a newly allocated OnButtonPress object
|
OnButtonPress(ButtonName buttonName,
ButtonPressMode buttonPressMode)
Constructs a newly allocated OnButtonPress object
|
OnButtonPress(Hashtable<String,Object> hash)
Constructs a newly allocated OnButtonPress object indicated by the
Hashtable parameter
|
| Modifier and Type | Method and Description |
|---|---|
ButtonName |
getButtonName()
Returns an ButtonName the button's name
|
ButtonPressMode |
getButtonPressMode()
Returns ButtonPressMode
|
Integer |
getCustomButtonID()
Get CustomButtonID of the button
If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button.
|
OnButtonPress |
setButtonName(ButtonName buttonName)
Set the button's name
|
OnButtonPress |
setButtonPressMode(ButtonPressMode buttonPressMode)
Set the button press mode of the event
|
OnButtonPress |
setCustomButtonID(Integer customButtonID)
Set CustomButtonID of the button
If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button.
|
getBoolean, getDouble, getFloat, getFunctionID, getFunctionName, getInteger, getLong, getMessageType, getObject, getParameters, getString, setFunctionName, setParametersclone, deserializeJSON, equals, format, formatObject, getBulkData, getMessageTypeName, getStore, getStoreValue, getValue, getValueForString, hashCode, hasKey, isPayloadProtected, serializeJSON, serializeJSON, setBulkData, setPayloadProtected, setValuepublic static final String KEY_BUTTON_PRESS_MODE
public static final String KEY_BUTTON_NAME
public static final String KEY_CUSTOM_BUTTON_ID
public OnButtonPress()
public OnButtonPress(Hashtable<String,Object> hash)
Constructs a newly allocated OnButtonPress object indicated by the Hashtable parameter
hash - The Hashtable to usepublic OnButtonPress(@NonNull
ButtonName buttonName,
@NonNull
ButtonPressMode buttonPressMode)
buttonName - name of the buttonbuttonPressMode - indicates whether this is a short or long presspublic ButtonName getButtonName()
Returns an ButtonName the button's name
public OnButtonPress setButtonName(@NonNull ButtonName buttonName)
Set the button's name
buttonName - name of the buttonpublic ButtonPressMode getButtonPressMode()
Returns ButtonPressMode
public OnButtonPress setButtonPressMode(@NonNull ButtonPressMode buttonPressMode)
Set the button press mode of the event
buttonPressMode - indicates whether this is a short or long presspublic OnButtonPress setCustomButtonID(Integer customButtonID)
customButtonID - CustomButtonID of the buttonpublic Integer getCustomButtonID()