Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search

Scrollable Message

A ScrollableMessage creates an overlay containing a large block of formatted text that can be scrolled. ScrollableMessage contains a body of text, a message timeout, and up to 8 soft buttons depending on head unit. You must check the DisplayCapabilities to get the max number of SoftButtons allowed by the head unit for a ScrollableMessage.

You simply create a ScrollableMessage RPC request and send it to display the Scrollable Message.


The message will persist on the screen until the timeout has elapsed or the user dismisses the message by selecting a soft button or cancelling (if the head unit provides cancel UI).

Scrollable Message UI

Scrollable Message

Creating the Scrollable Message

// Create Message To Display
String scrollableMessageText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare. Purus in massa tempor nec feugiat nisl pretium fusce id. Pharetra convallis posuere morbi leo urna molestie at elementum eu. Dictum sit amet justo donec enim diam.";

// Create SoftButtons
SoftButton softButton1 = new SoftButton(SoftButtonType.SBT_TEXT, 0);
softButton1.setText("Button 1");

SoftButton softButton2 = new SoftButton(SoftButtonType.SBT_TEXT, 1);
softButton2.setText("Button 2");

// Create SoftButton Array
List<SoftButton> softButtonList = Arrays.asList(softButton1, softButton2);

// Create ScrollableMessage Object
ScrollableMessage scrollableMessage = new ScrollableMessage();

// Send the scrollable message

To listen for OnButtonPress events for SoftButtons, we need to add a listener that listens for their Id's:

sdlManager.addOnRPCNotificationListener(FunctionID.ON_BUTTON_PRESS, new OnRPCNotificationListener() {
    public void onNotified(RPCNotification notification) {
        OnButtonPress onButtonPress = (OnButtonPress) notification;
        switch (onButtonPress.getCustomButtonName()){
            case 0:
                Log.i(TAG, "Button 1 Pressed");
            case 1:
                Log.i(TAG, "Button 2 Pressed");
View on GitHub.com
Previous Section Next Section