1

Now in my app, i use custom log for show only Debug.

and I saw a blog about make link to click logcat line and it go to that line.

private static String tag() {
        StackTraceElement trace = Thread.currentThread().getStackTrace()[4];
        String fileName = trace.getFileName();
        String classPath = trace.getClassName();
        String className = classPath.substring(classPath.lastIndexOf(".") + 1);
        String methodName = trace.getMethodName();
        int lineNumber = trace.getLineNumber();
        return TAG + "# " + className + "." + methodName + "(" + fileName + ":" + lineNumber + ")";
    }

now it show in logcat,

enter image description here

:68 and :195 is line Number. it is almost working. but, i can't click and go to code.

How I can solve this?

S T
  • 1,068
  • 2
  • 8
  • 16

0 Answers0