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();
|
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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue