gpt4 book ai didi

exception - 有没有办法在 Java ME 中打印堆栈跟踪到屏幕?

转载 作者:行者123 更新时间:2023-12-03 08:21:43 25 4
gpt4 key购买 nike

我有如下所示的代码,它可以很好地显示消息,但无法找到获取堆栈跟踪的任何方法。

try {
throw new RuntimeException("This is bad stuff!");
} catch (Exception e ) {
mainForm.append("Exception: " + e.getMessage());
}

调用 e.printStackTrace() 将它发送到我找不到的地方。

最佳答案

看这篇文章:
http://lwuit.blogspot.com/2008/12/redirecting-output-on-s60-devices.html

太糟糕了,没有 System.setErr(PrintWriter) 或 Thread.getStackTrace()

我认为这个问题没有(通用)解决方案

关于exception - 有没有办法在 Java ME 中打印堆栈跟踪到屏幕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/334527/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com