In JAVA, I have implemented a new menu item to the "New Appointment" window (of the calendar view).
In the run() method of my ApplicationMenuItem class, I need to retrieve the data that have been written by the user in the summary field.
The problem is the following. Let's suppose the following scenario:
1- The blackberry user enters a value in the summary field of the new appointment.
2- Then he clicks on my new menu item --> now run() method of my ApplicationMenuItem class is executed. At the beginning of the run() method, I need to know the value enters by the user in the summary field.
But as the user has not saved his appointment before invoking my command, I can't access the value of the summary field. I have tested to execute the following code, but it does not work:
Code:
public Object run(Object context)
{
try {
UiApplication.getUiApplication().getActiveScreen().save();
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
// Here, I would like to retrieve the value of the summary field, but don't know how
BlackBerryEvent e = (BlackBerryEvent) context;
String sum = e.getString(Event.SUMMARY, 0); // it is empty; why??
Then, I have tried the following code, but it does not work.
Code:
public Object run(Object context)
{
BlackBerryEvent e = (BlackBerryEvent) context;
try {
e.commit();
} catch (PIMException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
String sum = e.getString(Event.SUMMARY, 0); // it is empty, why ????
Do you have any idea?
Thanks in advance,
Mikaël.