I'm writing an application. It has a Service which is started using a receiver of android.intent.action.BOOT_COMPLETED
.
One of my app's users is reporting a strange problem (by the way, he is using LG Optimus One device with original 2.2 firmware) - after some interactions with my app (adding some data to a database which is used somehow by a Service) and after that resetting a device (hardware off and then on) device is going to infinite reboot just after 10 second after start.
I think this crash-n-restart is related to my app or it's service ('cause there is not such crash after hard-reset and using a phone without my app).
The question is.
- Is there any known bugs with LG Optimus One related to on-boot-starting a crashing service?
- How can i catch this bug? Is
adb logcat
is suitable here (is logcat is accessible right after the phone is powered on, when the BOOT_COMPLETED bro开发者_如何学JAVAadcast is sent?) - I there any other debug techniques which i can use in my case?
1) Don't know
2) Could you do this, works in an Activity not sure about service:
public void onCreate(){
Thread.setDefaultUncaughtExceptionHandler(onBlooey);
}
private Thread.UncaughtExceptionHandler onBlooey = new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread thread, Throwable ex) {
Log.e(TAG, "MAINPAGE Thread Uncaught exception", ex);
// Do what ever you want maybe send this exception to a dump file on the SD
}
};
3) The above
There is also this project on Remotely log unhandled exceptions in your Android applications.: http://code.google.com/p/android-remote-stacktrace/
EDIT
This answer could be helpful to you: How do I obtain crash-data from my Android application?
精彩评论