title: How to detect UI thread on Android?
body: <p>Is there a robust way to detect if <code>Thread.currentThread()</code> is the Android system UI thread in an application?<br>
  I would like to put some asserts in my model code that asserts that only one thread (<strong>eg</strong> the ui thread) accesses my state, to assure that no kind of synchronization is necessary.</p>