log Thread Signature for Alarm - Android java.lang

Android examples for java.lang:Thread

Description

log Thread Signature for Alarm

Demo Code


//package com.java2s;

import android.util.Log;

public class Main {
    public static void logThreadSignature() {
        Log.d("ThreadUtils", getThreadSignature());
    }// w w  w.  ja v a 2 s  . c  o m

    public static String getThreadSignature() {
        Thread t = Thread.currentThread();
        long l = t.getId();
        String name = t.getName();
        long p = t.getPriority();
        String gname = t.getThreadGroup().getName();
        return (name + ":(id)" + l + ":(priority)" + p + ":(group)" + gname);
    }
}

Related Tutorials