assert Not In Render Thread - Android java.lang

Android examples for java.lang:Thread

Description

assert Not In Render Thread

Demo Code

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"));
      }
    }
  }

}

Related Tutorials