07-01-2011 06:11 AM
hii, i need to retrieve all data registred in tasks ?
07-01-2011 11:41 AM
07-04-2011 02:50 AM
this link is damaged!! and my ask, is retrieve the tasks saved on blackberry (go to Applications ---> Tasks)
07-04-2011 04:07 AM
i found this code but i have three errors : ToDoList todoList = (ToDoList)PIM.getInstance().openToDoList(PIM.TODO_LIST, PIM.READ_ONLY); Enumeration enum = todoList.items(); while (enum.hasMoreElements()) { ToDo task = (ToDo)enum.nextElement(); int[] fieldIds = task.getFields(); int id; for(int index = 0; index < fieldIds.length; ++index) { id = fieldIds[index]; if(task.getPIMList().getFieldDataType(id) == STRING) { for(int j=0; j < task.countValues(id); ++j) { String value = task.getString(id, j); System.out.println(task.getFieldLable(id) + "=" + value); } } } }
the first on ToDoList todoList = (ToDoList)PIM.getInstance().openToDoList(PIM.TODO_LIST, PIM.READ_ONLY);
cannot find symbol
symbol : method openToDoList(int,int)
the second:
if(task.getPIMList().getFieldDataType(id) == STRING)
cannot find symbol
symbol : variable STRING
the third:
System.out.println(task.getFieldLable(id) + "=" + value);
cannot find symbol
symbol : method getFieldLable(int)
07-04-2011 06:58 AM
Hi,
I used this code and its working... try it out..
try
{
ToDoList todo=(ToDoList)PIM.getInstance().openPIMList( PIM.TODO_LIST, PIM.READ_ONLY);
}
catch(PIMException e) {
e.printStackTrace();
}
try{
Enumeration events = todo.items();
}
catch(PIMException e1) {
e1.printStackTrace();
}
ToDo toDo = (ToDo)events.nextElement();
Dialog.alert(toDo.getString(ToDo.NOTE, 0));
08-02-2011 03:37 AM
in thi code i have an exception on
ToDo toDo = (ToDo)events.nextElement();
Dialog.alert(toDo.getString(ToDo.NOTE, 0));
the error is IndexOutofBoundsException
08-02-2011 05:15 AM
Check the API documentation. What does it say about this?
08-02-2011 01:10 PM
try pasting the line inside try.. mostly the error is because events is null.. try addin new tasks and run the app...