Refactor deprecated widget code

This replaces the deprecated widget method with the new one and ensures
it consistently updates on changes.
This commit is contained in:
Sylvia van Os
2025-07-13 23:24:40 +02:00
parent 9a0149def8
commit 7277ff26fc
6 changed files with 91 additions and 126 deletions

View File

@@ -431,13 +431,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
mCurrentActionMode.finish();
}
updateWidget(mAdapter.mContext);
}
private void updateWidget(Context context) {
AppWidgetManager manager = AppWidgetManager.getInstance(context);
int[] ids = manager.getAppWidgetIds(new ComponentName(context, CatimaWidget.class));
manager.notifyAppWidgetViewDataChanged(ids, R.id.grid_view);
new CatimaWidget().updateAll(mAdapter.mContext);
}
private void processParseResultList(List<ParseResult> parseResultList, String group, boolean closeAppOnNoBarcode) {