Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Regular Contributor
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520
My Carrier: TMN

Re: Queue too large

Hi,
I'm using Synchronized on the event lock. 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();
Regular Contributor
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520
My Carrier: TMN

Re: Queue too large

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();

Highlighted
Regular Contributor
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520
My Carrier: TMN

Re: Queue too large

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");
                        
                        
                    }

Regular Contributor
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520
My Carrier: TMN

Re: Queue too large

Sorry for the repeated text. My computer is slow.

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Queue too large

If you comment out the ui portion, do you still get the error? We need to rule it out.

Regular Contributor
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520
My Carrier: TMN

Re: Queue too large

No, if I comment I doesn't have this error. If I add too many screen to the Global screen it could be the reason for that? Maybe the user execute this action too many times.
Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Queue too large

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?