Help Center
Local Navigation
- Creating user interfaces
- Storing data
- Creating connections
- Managing applications
- Using custom messages and folders in the message list
- Creating a module for background processes
- Creating a module for the UI
- Create the module for background processes
- Start the module for background processes or the module for the UI
- Create an icon for a custom message
- Create a custom folder in the message list
- Send a notification when a custom folder changes
- Create an indicator for the number of messages in a custom folder
- Hide an indicator for a custom folder
- Remove an indicator for a custom folder
- Applications for push content
- Localizing BlackBerry device applications
- Controlling access to APIs and application data
- Testing a BlackBerry device application
- Packaging and distributing a BlackBerry Java Application
- Glossary
- Provide feedback
- Legal notice
BlackBerry Manuals & Help
>
Documentation for Developers
>
Java Development Guides and API Reference
>
Development Guide - BlackBerry Java Development Environment - 4.7.0
Start the module for background processes or the module for the UI
- Import the net.rim.blackberry.api.messagelist.ApplicationMessageFolderRegistry class.
- Create a main method for the BlackBerry®device application.
public static void main( String[] args ) { try { - In the main() method, check if the value of the args parameter indicates that the BlackBerrydevice application
should start the daemon module.
if( args.length == 1 && args[ 0 ].equals( "daemon" ) ) { - Create an instance of a class that contains the daemon functionality and items.
MLSampleDaemon daemon = new MLSampleDaemon();
- Obtain a reference to the ApplicationMessageFolderRegistry.
ApplicationMessageFolderRegistry reg = ApplicationMessageFolderRegistry.getInstance();
- In the main() method, check if the value of the args parameter indicates that the BlackBerrydevice application
should start the UI module.
} else if( args.length == 1 && args[ 0 ].equals( "gui" ) ) { - Create an instance of a class that contains the UI functionality and items.
MLSampleGui gui = new MLSampleGui();
- Display the UI for the BlackBerrydevice application
.
gui.showGui();
- Add the application to the event dispatcher.
gui.enterEventDispatcher();
Parent topic: Using custom messages and folders in the message list