View or change a task
- Import the required classes and interfaces.
import java.util.Enumeration;
import javax.microedition.pim.PIM;
import javax.microedition.pim.ToDo;
import javax.microedition.pim.ToDoList;
import net.rim.blackberry.api.invoke.Invoke;
import net.rim.blackberry.api.invoke.TaskArguments;
- Create an instance of a ToDoList and store it in an Enumeration.
ToDoList tdl = (ToDoList)PIM.getInstance().openPIMList(PIM.TODO_LIST,
PIM.READ_WRITE);
Enumeration todos = tdl.items();
- Create a ToDo object using an element from the Enumeration.
ToDo todo = (ToDo)todos.nextElement();
- Invoke Invoke.invokeApplication() using the APP_TYPE_TASKS field, and a new TaskArguments object created using the ARG_VIEW field and the ToDo object.
Invoke.invokeApplication(Invoke.APP_TYPE_TASKS,
new TaskArguments(TaskArguments.ARG_VIEW, todo));
Was this information helpful? Send us your comments.