質問編集履歴
1
アダプタークラス追記しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -43,4 +43,35 @@
|
|
43
43
|
|
44
44
|
}
|
45
45
|
|
46
|
+
```
|
47
|
+
カスタムアダプタークラス
|
48
|
+
```ここに言語を入力
|
49
|
+
ublic class CustomAdapter extends ArrayAdapter<MemberProfile> {
|
50
|
+
|
51
|
+
//CustomAdapterのコンストラクター
|
52
|
+
public CustomAdapter(Context context, List<MemberProfile> objects) {
|
53
|
+
super(context, R.layout.custom_list2, R.id.text, objects);
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
@Override
|
58
|
+
public View getView(int position, View convertView, ViewGroup parent) {
|
59
|
+
//カスタムレイアウトをviewの中で保持
|
60
|
+
View view = super.getView(position, convertView, parent);
|
61
|
+
TextView text = (TextView)view.findViewById(R.id.text);
|
62
|
+
TextView text2 = (TextView)view.findViewById(R.id.text2);
|
63
|
+
ImageView image = (ImageView) view.findViewById(R.id.image);
|
64
|
+
|
65
|
+
MemberProfile memberProfile = getItem(position);
|
66
|
+
|
67
|
+
//
|
68
|
+
text.setText(memberProfile.getName());
|
69
|
+
text2.setText(memberProfile.getJob());
|
70
|
+
image.setImageBitmap(memberProfile.getImage());
|
71
|
+
|
72
|
+
|
73
|
+
return view;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
46
77
|
```
|