Guest User

Untitled

a guest
Aug 12th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public class listAdapter extends ArrayAdapter {
  2.  
  3. public listAdapter(Context context, String[] names, Integer[] photos) {
  4. super(context, R.layout.customlist, names);
  5.  
  6. }
  7.  
  8. @Override
  9. public View getView(int position, View convertView, ViewGroup parent) {
  10. LayoutInflater myInflater = (LayoutInflater.from(getContext()));
  11. View customView = myInflater.inflate(R.layout.customlist, parent, false);
  12.  
  13. String singleName = getItem(position);
  14. Integer singleImage = getItem(position);
  15. TextView myText = (TextView) customView.findViewById(R.id.myText);
  16. ImageView myImage = (ImageView) customView.findViewById(R.id.myImage);
  17.  
  18. myText.setText(singleName);
  19. myImage.setImageResource(singleImage);
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment