You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be an issue with the check if a dispatch happens on the main-thread. In the ThreadUtils class the check is like follows:
publicstaticbooleanisOnMain() {
returngetId() != 1;//fingers crossed. This might be an issue.
}
publicstaticvoidensureNotOnMain(){
if(isOnMain())
thrownewDispatchOnMainThreadException();
}
Souldn´t the isOnMain method be implemented with getId() == 1? Saying if the id == 1 then we are on the main thread. In the current implementaton we return true only if we are on a thread an id other than 1.
Besides, does the main-thread check even make sense for a pure java implementation? Most UI libraries have teir own ui-thread (swings EventDispatchThread, or javaFXs application thread). But these threads will always differ from the thread with id 1.
The text was updated successfully, but these errors were encountered:
Nice catch. I'm not sure what I was smoking when I wrote that.
Concerning the thread id on java, I've always known this is an issue hence the comment.
I'll have to fix check for android and convert the check to a delegate in pure Java for custom implementations.
There seems to be an issue with the check if a dispatch happens on the main-thread. In the
ThreadUtils
class the check is like follows:Souldn´t the
isOnMain
method be implemented withgetId() == 1
? Saying if the id == 1 then we are on the main thread. In the current implementaton we returntrue
only if we are on a thread an id other than 1.Besides, does the main-thread check even make sense for a pure java implementation? Most UI libraries have teir own ui-thread (swings EventDispatchThread, or javaFXs application thread). But these threads will always differ from the thread with id 1.
The text was updated successfully, but these errors were encountered: