1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 10:35:50 +01:00

Xiaomi: Fix crash when deleting last widget screen

This commit is contained in:
José Rebelo 2024-04-12 22:41:11 +01:00
parent 5e6bf798a4
commit 320fccbaae

View File

@ -159,9 +159,9 @@ public class WidgetScreensListActivity extends AbstractGBActivity {
public void deleteWidgetScreen(final WidgetScreen widgetScreen) {
if (mGBWidgetScreenListAdapter.getItemCount() - 1 < widgetManager.getMinScreens()) {
// Under minimum slots
new MaterialAlertDialogBuilder(this.getBaseContext())
new MaterialAlertDialogBuilder(this)
.setTitle(R.string.widget_screen_delete_confirm_title)
.setMessage(getBaseContext().getString(R.string.widget_screen_min_screens, String.format(Locale.getDefault(), "%d", widgetManager.getMinScreens())))
.setMessage(this.getString(R.string.widget_screen_min_screens, String.format(Locale.getDefault(), "%d", widgetManager.getMinScreens())))
.setIcon(R.drawable.ic_warning)
.setPositiveButton(android.R.string.ok, (dialog, whichButton) -> {
})