Sounds like you are not wrapping your TaskListener in a TaskAdapter. You need to do this to ensure that the handler is called on the UI thread.
On May 10, 2011, at 4:02 PM, Olivier Dutrieux wrote: > Le 10/05/2011 13:20, Noel Grandin a écrit : >> Hi >> >> Do you have a test-case (ie. some sample code) for this? >> >> Thanks, Noel. >> >> > > In fact the real exception is : > > java.lang.IllegalStateException: this method can only be called from the AWT > event dispatch thread > at > org.apache.pivot.wtk.Container.assertEventDispatchThread(Container.java:853) > at org.apache.pivot.wtk.WTKListenerList.iterator(WTKListenerList.java:79) > at > org.apache.pivot.wtk.ActivityIndicator$ActivityIndicatorListenerList.activeChanged(ActivityIndicator.java:29) > at > org.apache.pivot.wtk.ActivityIndicator.setActive(ActivityIndicator.java:50) > > I think is due to the new verification > (Container.assertEventDispatchThread()) on all wtk components. I active the > ActivityIndicator on the execute method of my task. > > What is the best pratice ? > > see my attach sample. > > Duto > <src.rar>
