1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-12 11:44:19 +02:00

fix bug if no reference user is avialable, see #827

This commit is contained in:
oliexdev
2022-04-16 08:49:30 +02:00
parent d022cd321c
commit a4477e0905

View File

@@ -484,6 +484,11 @@ public class MainActivity extends AppCompatActivity
builder.setPositiveButton(R.string.label_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (userIds.isEmpty()) {
Toast.makeText(getApplicationContext(), getString(R.string.info_assisted_weighing_no_reference_user), Toast.LENGTH_LONG).show();
return;
}
int selectedPosition = ((AlertDialog)dialog).getListView().getCheckedItemPosition();
prefs.edit().putInt("assistedWeighingRefUserId", userIds.get(selectedPosition)).commit();