Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class listAdapter extends ArrayAdapter {
- public listAdapter(Context context, String[] names, Integer[] photos) {
- super(context, R.layout.customlist, names);
- }
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- LayoutInflater myInflater = (LayoutInflater.from(getContext()));
- View customView = myInflater.inflate(R.layout.customlist, parent, false);
- String singleName = getItem(position);
- Integer singleImage = getItem(position);
- TextView myText = (TextView) customView.findViewById(R.id.myText);
- ImageView myImage = (ImageView) customView.findViewById(R.id.myImage);
- myText.setText(singleName);
- myImage.setImageResource(singleImage);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment