cancel
Showing results for 
Search instead for 
Did you mean: 

Update eSWT from different thread

former_member79518
Discoverer
0 Kudos

Hi

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.

thanks

Andrew

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member79518
Discoverer
0 Kudos

The class

com.sap.tc.mobile.wdlite.progmodel.core.WDLite

has methods syncExec and asyncExec which can be used to update the UI from a different thread.