reset saved widget value on AC
This commit is contained in:
parent
cb12d04111
commit
1a7cd32464
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue