Issue
I would like to have a quick way to be able to log all the calls to all the super methods called by the activity.
I have tried this https://github.com/stephanenicolas/loglifecycle
but for some reason it does not work with AppCompatActivity...
I could ask my IDE to override all the methods; but how to add Log to all of them? Manually? There must be a way..
Solution
You could go around and play yourself with stacktrace
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
From the docs:
The last element of the array represents the bottom of the stack, which is the least recent method invocation in the sequence.
EDIT: There seems to be a whole post about this HERE
Answered By - Bojan Kseneman
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.