Given the function as below, AndroidStudio gives an error in the labeled line:
array type expected found java.util.arraylist
I also tried to use get instead of a direct referencing, but then Android Studio is telling me something that setItems cannot be resolved. The code is here:
protected void multiSelect(final ArrayList items) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Selection")
.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Log.i("Select", "Selected entry: " + items[item]); // error here
}
});
builder.create();
}