I have a protobuf message of type OrderList
message OrderList {
repeated Order orders = 1;
}
I want to pass this list of orders into a custom adapter that I wrote.
void guiUpdateOrders(final OrderList new_order_list) {
setListAdapter(new OrderRowAdapter(OrderActivity.this, R.layout.order_row,
(ArrayList<Order>) new_order_list.getOrdersList()));
}
But when I do this, I get the following error
java.lang.ClassCastException: java.util.Collections$UnmodifiableRandomAccessList
Weird that the
ListViewwants a modifiable copy of theListto be supplied to the adapter.Can you try giving it what it wants?