wingkvm.blogg.se

Overriding code file scavenger 4.0
Overriding code file scavenger 4.0




String fullFileName = extractLogToFile() // code not shown Private void handleUncaughtException (Thread thread, Throwable e) tDefaultUncaughtExceptionHandler (new void uncaughtException (Thread thread, Throwable e) Here are some code snips as a starting guide: public class MyApplication extends ApplicationĭefaultUncaughtHandler = Thread.getDefaultUncaughtExceptionHandler() These methods are supported by Activity but not by Application. That is, normally to start an activity one calls startActivity and resumes with onActivityResult. Since that isn't an Activity, it's not obvious how to start an activity with Intent.ACTION_SEND. The crux of the problem is that the unhandled exception is caught in my Application class. If I get the email activity working, I don't expect much trouble for the other. Ultimately, I'll have yet another activity to ask the user's permission. What doesn't work yet: (3) starting an activity to send email. What works: (1) trapping the uncaught exception, (2) extracting log info and writing to a file. This is turning out to be trickier than I expected :) I realize that doing more work after getting a random exception is risky but, hey, the worst is the app finishes crashing and the log file doesn't get sent. When my app creates an unhandled exception, rather than simply terminating, I'd like to first give the user an opportunity to send a log file.






Overriding code file scavenger 4.0