Open a task list

  1. Import the required classes and interfaces.
    import javax.microedition.pim.PIM;
    import javax.microedition.pim.PIMException;
    import javax.microedition.pim.ToDoList;
    
  2. Invoke PIM.openPIMList() and provide as parameters the type of list to open (PIM.TODO_LIST) and the access mode with which to open the list (READ_WRITE, READ_ONLY, or WRITE_ONLY).
    ToDoList todoList = null;
    try 
    {
       todoList = (ToDoList)PIM.getInstance().openPIMList(PIM.TODO_LIST, 
          PIM.READ_WRITE);
    } 
    catch (PimException e) 
    {
       // handle exception here 
    }
Next topic: Create a task

Was this information helpful? Send us your comments.