Okay. This is how you could get a StackTrace and write it to a String:
try
{
//code here
}
catch(Exception e)
{
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
String stacktrace = sw.toString();
}
try
{
//code here
}
catch(Exception e)
{
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
String stacktrace = sw.toString();
}
Comments
By the way, only google hit to the following search terms:
java exception "stacktrace to string"
Thanks
Marcel
Glad that you found it useful :)
Most the VM's on Phone don't even pass the message version of the exception.. and hence at least knowing the stack trace would help a lot..
Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com