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