I have a large list of users displayed in AlertDialog as a selection list. This is the code I use to create it:
AlertDialog.Builder builder = new AlertDialog.Builder(thisContext);
builder.setTitle("User");
builder.setItems(userNames, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int pos) {
}});
builder.setNeutralButton("Clear", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
});
dialog=builder.create();
dialog.getListView().setFastScrollEnabled(true);
dialog.show();
userNames is an algebraic list of names from the database.
This works very well for the most part, however, since I have more than 100 or more users, scrolling through the list is a bit slower. How can I add quick scrolling so that users can jump to the next part of the list if necessary?
source
share