reset saved widget value on AC

This commit is contained in:
tibbi 2016-01-03 20:29:47 +01:00
parent cb12d04111
commit 1a7cd32464
1 changed files with 5 additions and 0 deletions

View File

@ -155,6 +155,7 @@ public class MyWidgetProvider extends AppWidgetProvider implements Calculator {
calc.handleClear(); calc.handleClear();
break; break;
case Constants.RESET: case Constants.RESET:
resetSavedValue(context);
calc.handleReset(); calc.handleReset();
break; break;
case Constants.PLUS: case Constants.PLUS:
@ -186,6 +187,10 @@ public class MyWidgetProvider extends AppWidgetProvider implements Calculator {
@Override @Override
public void onDeleted(Context context, int[] appWidgetIds) { public void onDeleted(Context context, int[] appWidgetIds) {
super.onDeleted(context, appWidgetIds); super.onDeleted(context, appWidgetIds);
resetSavedValue(context);
}
private void resetSavedValue(Context context) {
if (prefs == null) if (prefs == null)
prefs = initPrefs(context); prefs = initPrefs(context);