Search code examples
codenameone

Add Button to ToastBar Component


Is it possible to add a component, like Button to a ToastBar? I want to add an action button that loads a new form when its clicked. Or is there any method exposed to add listeners to a ToastBar component?


Solution

  • Sure use something like:

    tb.addMaterialCommandToRightSideMenu("", FontImage.MATERIAL_OPEN_WITH, e -> {
        // button click event
    });