Android examples for java.lang:Thread
assert Not In Render Thread
import android.util.Log; public class Main { private static volatile boolean sWarned; private static final String TAG = "AlbumUtils"; private static volatile Thread sCurrentThread; public static void assertNotInRenderThread() { if (!sWarned) { if (Thread.currentThread() == sCurrentThread) { sWarned = true;/* www . j a va 2s .c om*/ Log.w(TAG, new Throwable("Should not do this in render thread")); } } } }