Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public @NonNull View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
- final View view = mInflater.inflate(R.layout.my_custom_spinner_item, parent, false);
- TextView savingsTV = (TextView) view.findViewById(R.id.tv_savings);
- TextView accountNumberTV = (TextView) view.findViewById(R.id.tv_account_number);
- TextView balanceTV = (TextView) view.findViewById(R.id.tv_balance);
- CustomObject object = objectsList.get(position);
- // Format your fields to strings here
- savingsTV.setText(object.getSavings());
- accountNumberTV.setText(object.getAccountNumber());
- balanceTV.setText(object.getBalance());
- return view;
- }
- spinner = (Spinner) findViewById(R.id.spinner);
- CustomArrayAdapter adapter = new CustomArrayAdapter(this, getList());
- spinner.setAdapter(adapter);
Add Comment
Please, Sign In to add comment