10-08-2012 12:38 PM
10-08-2012 12:40 PM
I'am using synchronized (Application.getEventLock()).
My code is:
new Thread(){
public void run(){
Logger.logAlwaysEvent("[Contact Customer Care] Number of Threads:" + Thread.activeCount());
Logger.logAlwaysEvent("[Contact Customer Care] inserting json event");
insertJsonEvent(message);
Logger.logAlwaysEvent("[Contact Customer Care] json event inserted");
Logger.logAlwaysEvent("[Contact Customer Care] generating and sending json files to the server...");
int resourceResponse = CONTACT_CUSTOMER_CARE_RESPONSE;
try {
sendJsonToTheServer();
Logger.logAlwaysEvent("[Contact Customer Care] Json files sent.");
} catch (Exception e) {
resourceResponse = CONTACT_CUSTOMER_CARE_ERROR_RESPONSE;
Logger.logAlwaysEvent("[Contact Customer Care] Exception:" + e.getMessage());
}
synchronized (Application.getEventLock()) {
Logger.logAlwaysEvent("[Contact Customer Care] Dialog to inform customer of response");
UiEngine ui = Ui.getUiEngine();
Screen screen = new Dialog(Dialog.D_OK,
AppMain.getResources().getString(resourceResponse)
Dialog.OK,
Bitmap.getPredefinedBitmap(Bitmap.INFORMATION),
Manager.VERTICAL_SCROLL);
ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
// ui.pushModalScreen(screen);
Logger.logAlwaysEvent("[Contact Customer Care] Dialog was shown");
}
//appMain.contactCustomerCareChangeState();
}
}.start();
10-08-2012 12:44 PM
I'am using Synchronized on the event lock. My code is:
synchronized (Application.getEventLock()) {
Logger.logAlwaysEvent("[Contact Customer Care] Dialog to inform customer of response");
UiEngine ui = Ui.getUiEngine();
Screen screen = new Dialog(Dialog.D_OK,
AppMain.getResources().getString(resourceResponse)
Dialog.OK,
Bitmap.getPredefinedBitmap(Bitmap.INFORMATION),
Manager.VERTICAL_SCROLL);
ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
// ui.pushModalScreen(screen);
Logger.logAlwaysEvent("[Contact Customer Care] Dialog was shown");
}
10-08-2012 12:46 PM
Sorry for the repeated text. My computer is slow.
10-08-2012 01:32 PM
If you comment out the ui portion, do you still get the error? We need to rule it out.
10-08-2012 01:39 PM
10-08-2012 01:56 PM
Could be. Not sure what your screen is for, but it doesn't sound like it should be displaying so many, so maybe you should add some check to make sure the action doesn't run multiple times?