Skip to Content
May 12, 2011 at 11:02 AM

Update eSWT from different thread



We are developing an application running on MI using eSWT. It runs on a device which has a scanner.

The event from the scanner gets processed in a different thread from the UI thread. When I update an attribute with the scanned barcode, the binding gets triggered to update the UI and because it happens in a different thread I get the following exception:

org.eclipse.swt.SWTException: Invalid thread access

The only advice I found was to use Display.getDefault().syncExec or asyncExec, but the eSWT classes are not accessable by default.

Is there any way using the API to an MI Handheld application to accomplish it.