Change task information

  1. Import the required classes and interfaces.
    import javax.microedition.pim.ToDo;
    import javax.microedition.pim.ToDoList;
  2. To replace an existing value with a new value, invoke the appropriate set method, such as ToDo.setString().
  3. To determine if a value is already set for the field, invoke ToDo.countValues().
    if (task.countValues(ToDo.SUMMARY) > 0) 
       task.setString(ToDo.SUMMARY, 0, ToDo.ATTR_NONE, "Review notes");
  4. Create code to manage a FieldFullException that a method such as addString() throws when a value already exists.
Next topic: Save a task
Previous topic: Add task information

Was this information helpful? Send us your comments.