Help Center
Local Navigation
- Integrating with BlackBerry Device Software applications
- Unified search
- Device interaction support
- Message list
- Custom messages
- Attachments
- Calendar
- Contact list
-
Task list
- View or change a task
- Create a new blank task
- Create a new populated task
- Open a task list
- Create a task
- Add task information
- Change task information
- Save a task
- Retrieve task information
- Export a task
- Import a task
- Delete a task
- Close the task list
- Notify a BlackBerry device application when a list of tasks changes
- Phone
- BlackBerry Browser
- Menu items
- Find more information
- Glossary
- Provide feedback
- Document revision history
- Legal notice
BlackBerry Manuals & Help
>
Developer Documentation
>
Java Development Guides and API Reference
>
Development Guide
Integration - BlackBerry Java SDK - 6.0
Add task information
- Import the required classes and interfaces.
import java.util.Date; import javax.microedition.pim.PIMList; import javax.microedition.pim.ToDo; import javax.microedition.pim.ToDoList;
- Before you set or retrieve a field, verify that the item supports the field by invoking ToDoList.isSupportedField(int).
- Invoke PIMList.getFieldDataType(int) to retrieve the field data type.
- Invoke one of the following methods
to set the field data:
if (todoList.isSupportedField(ToDo.SUMMARY)) { task.addString(ToDo.SUMMARY, ToDo.ATTR_NONE, "Create project plan"); } if (todoList.isSupportedField(ToDo.DUE)) { Date date = new Date(); task.addDate(ToDo.DUE, ToDo.ATTR_NONE, (date + 17280000)); } if (todoList.isSupportedField(ToDo.NOTE)) { task.addString(ToDo.NOTE, ToDo.ATTR_NONE, "Required for meeting"); } if (todoList.isSupportedField(ToDo.PRIORITY)) { task.addInt(Todo.PRIORITY, ToDo.ATTR_NONE, 2); }
Next topic: Change task information
Previous topic: Create a task