How to detect GUI thread on Android?

Posted by ParDroid on Stack Overflow See other posts from Stack Overflow or by ParDroid
Published on 2010-05-17T11:26:08Z Indexed on 2010/05/17 11:30 UTC
Read the original article Hit count: 122

Filed under:

Is there a robust way to detect if Thread.currentThread() is the Android system GUI-thread in an application? I would like to put some asserts in my model code that asserts that only one thread (eg the gui-thread) accesses my state, to assure that no kind of synchronization is neccesary.

© Stack Overflow or respective owner

Related posts about android