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

Reply
Developer
Posts: 191
Registered: ‎04-02-2013
My Device: BlackBerry Bold 9900
My Carrier: developer
Accepted Solution

How to release event lock?

Hi

I have used the EventLock in my application

synchronized (UiApplication.getEventLock())
{

}

 

Now i want to know how to release it?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to release event lock?

I recommend that you review the documentation for synchronized, or perhaps this tutorial:

http://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html

 

And as I have said to you before, do not use this unless you know what you are doing.  In this case, it seems clear that you don't, so I would recommend that you always use invokeLater as follows:

 

    UiApplication.getUiApplication().invokeLater(new Runnable() {
     public void run()
     {

// your code goes in here

     }
    });