Example usage for android.os Looper dump

List of usage examples for android.os Looper dump

Introduction

In this page you can find the example usage for android.os Looper dump.

Prototype

public void dump(@NonNull Printer pw, @NonNull String prefix) 

Source Link

Document

Dumps the state of the looper for debugging purposes.

Usage

From source file:com.idisplay.base.IDisplayApp.java

private void dumpMainLooper(String str) {
    try {/* www  .  j  a  v a2  s  .co  m*/
        Looper mainLooper = getMainLooper();
        if (mainLooper != null) {
            Logger.d("Main Thread " + str + " Looper:");
            try {
                mainLooper.dump(new Printer() {
                    public void println(String str) {
                        Logger.d(str);
                    }
                }, StringUtils.EMPTY);
                return;
            } catch (Throwable th) {
                Logger.d("Main Thread " + str + " Looper error", th);
            }
        }
        Logger.e("Main Thread " + str + " Looper is NULL");
    } catch (Throwable th2) {
        Logger.d("Main Thread " + str + " get Looper error", th2);
    }
}