get Thread Info: thread name and thread id - Android java.lang

Android examples for java.lang:Thread

Description

get Thread Info: thread name and thread id

Demo Code

import android.media.AudioManager;
import android.os.Build;
import android.util.Log;

public class Main{


    /** Helper method for building a string of thread information.*/
    public static String getThreadInfo() {
        return "@[name=" + Thread.currentThread().getName() + ", id="
                + Thread.currentThread().getId() + "]";
    }// w  w w  .  j a va 2 s  .  co  m

}

Related Tutorials