I have developed an Android Widget, and it was working fine. I added some extra functionality and pushed an update through the Android Market. Now people are complaining tha
Somewhat off-topic, but in some Android devices one can reproducibly cause this failure by writing an app which creates an UncaughtExceptionHandler in onCreate to restart the app after a crash, and then does something to cause an unhandled exception (either throw a RuntimeException, or do something that causes an NullPointerException, or whatever). Some example code is given below.
I have tried this on two devices: a Samsung Galaxy Tab 2, and a Verizon Ellipsis 7. With the Tab 2, I couldn't cause the issue while I was running the app from Eclipse -- it would crash and restart repeatedly and never be killed. Instead, I had to export the app to apk, install via adb, start the app, and after 4-8 crashes and restarts, Android would kill the app with the error message above (Process com.buggy.app has crashed too many times: killing!).
With the Ellipsis 7, I was never able to reproduce the issue. The buggy app would repeatedly crash and restart, and the OS never killed it even after 10 minutes of this.
Sample code for repeatedly crashing app:
public void onCreate(Bundle savedInstanceState) {
mContext = this.getApplicationContext();
UncaughtExceptionHandler uehandler = new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
// restart app after 100 milliseconds
PendingIntent myActivity = PendingIntent.getActivity(mContext, 0,
new Intent(mContext, MyActivity.class),
PendingIntent.FLAG_ONE_SHOT);
AlarmManager alarmManager = (AlarmManager)
mContext.getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC, System.currentTimeMillis() + 100,
myActivity);
System.exit(2);
// re-throw critical exception further to the os (important)
Thread.getDefaultUncaughtExceptionHandler().uncaughtException(thread, ex);
}
};
Thread.setDefaultUncaughtExceptionHandler(uehandler);
throw new RuntimeException("Crash the app!");
}