While developing Android application, from time to time I face a situation when an exception occures, but can not be traced down through a stack, because the stack which is shown at such moments mentions only system methods, and not any of my code lines. For example, if I erroneusly pass an incorrect string to Float.parseFloat, I got something like this:
Thread [<1> main] (Suspended)
LoadedApk$ReceiverDispatcher$Args.run() line: 710
ActivityThread$H(Handler).handleCallback(Message) line: 587
ActivityThread$H(Handler).dispatchMessage(Message) line: 92
Looper.loop() line: 123
ActivityThread.main(String[]) line: 3729
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 507
ZygoteInit$MethodAndArgsCaller.run() line: 874
ZygoteInit.main(String[]) line: 632
NativeStart.main(String[]) line: not available [native method]
and this:
Thread [<1> main] (Suspended (exception RuntimeException))
LoadedApk$ReceiverDispatcher$Args.run() line: 722
ActivityThread$H(Handler).handleCallback(Message) line: 587
ActivityThread$H(Handler).dispatchMessage(Message) line: 92
Looper.loop() line: 123
ActivityThread.main(String[]) line: 3729
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 507
ZygoteInit$MethodAndArgsCaller.run() line: 874
ZygoteInit.main(String[]) line: 632
NativeStart.main(String[]) line: not available [native method]
The question is - how can I pinpoint a line of my code, which causes the problem? In the case of incorrect parseFloat usage, I'd expect to see a mention of parseFloat in the stack and my methods which contain the invocation.