mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 985875 - Set selected item in adapter for single select lists. r=bnicholson
This commit is contained in:
parent
7332c1b9f8
commit
bef2c90b3f
@ -268,6 +268,15 @@ public class Prompt implements OnClickListener, OnCancelListener, OnItemClickLis
|
|||||||
builder.setSingleChoiceItems(mAdapter, mAdapter.getSelectedIndex(), new DialogInterface.OnClickListener() {
|
builder.setSingleChoiceItems(mAdapter, mAdapter.getSelectedIndex(), new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
// The adapter isn't aware of single vs. multi choice lists, so manually
|
||||||
|
// clear any other selected items first.
|
||||||
|
ArrayList<Integer> selected = mAdapter.getSelected();
|
||||||
|
for (Integer sel : selected) {
|
||||||
|
mAdapter.toggleSelected(sel);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now select this item.
|
||||||
|
mAdapter.toggleSelected(which);
|
||||||
closeIfNoButtons(which);
|
closeIfNoButtons(which);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user