have a code:
val booksForDelete = arguments?.getParcelableArray("books")
val builder = AlertDialog.Builder(activity)
val checkedItem = -1
builder.setTitle("Choose the book for DELETE")
.setSingleChoiceItems(booksForDelete?.**map**(Book::title)?.toTypedArray(),checkedItem){dialog, which ->
Toast.makeText(activity,"Choosen book: ${booksForDelete?.map { Book::title}?.get(which)}",Toast.LENGTH_SHORT).show()
}
в строке ".setSingleChoiceItems ..." есть ошибка - отмечена "карта". Что не так?
PS
data class Book(val title: String, val id: Int) : Parcelable {
constructor(source: Parcel) : this(
source.readString()!!,
source.readInt()
)