Below is my code for base adapter. I will be using this class as an adapter for a ListView
.
public class CustombaseAdapterTxnCartSelect extends BaseAdapter
{
private Context mContext;
private List<RowItemTxnCartSelect> mRowItems;
TextView standDesc, seats, totalTicketTariff, eventDesc;
public CustombaseAdapterTxnCartSelect(Context context, List<RowItemTxnCartSelect> rowItems) {
mContext = context;
mRowItems = rowItems;
}
@Override
public int getCount() {
return mRowItems.size();
}
@Override
public Object getItem(int position) {
return mRowItems.get(position);
}
@Override
public long getItemId(int position) {
return mRowItems.indexOf(getItem(position));
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView = null;
LayoutInflater mInflator = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = mInflator.inflate(R.layout.event_layout_txn__cart_select, null);
standDesc = (TextView) convertView.findViewById(R.id.textViewTxnCartSelectStandDesc);
seats = (TextView) convertView.findViewById(R.id.textViewTxnCartSelectSeats);
totalTicketTariff = (TextView) convertView.findViewById(R.id.textViewTxnCartSelectTotalTicketTariff);
eventDesc = (TextView) convertView.findViewById(R.id.textViewEventDesc);
RowItemTxnCartSelect row = (RowItemTxnCartSelect) getItem(position);
standDesc.setText(row.getmStandDesc());
seats.setText(row.getmSeats());
totalTicketTariff.setText(row.getMtotalTicketTariff());
eventDesc.setText(row.getmEventDesc());
return convertView;
}
}
I just want to convert it into an expandable list view I'm not clear about what all I have to add.