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:
@@ -484,6 +484,11 @@ public class MainActivity extends AppCompatActivity
|
|||||||
builder.setPositiveButton(R.string.label_ok, new DialogInterface.OnClickListener() {
|
builder.setPositiveButton(R.string.label_ok, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
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();
|
int selectedPosition = ((AlertDialog)dialog).getListView().getCheckedItemPosition();
|
||||||
prefs.edit().putInt("assistedWeighingRefUserId", userIds.get(selectedPosition)).commit();
|
prefs.edit().putInt("assistedWeighingRefUserId", userIds.get(selectedPosition)).commit();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user