質問編集履歴
1
アダプタークラス追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -89,3 +89,65 @@
|
|
89
89
|
|
90
90
|
|
91
91
|
```
|
92
|
+
|
93
|
+
カスタムアダプタークラス
|
94
|
+
|
95
|
+
```ここに言語を入力
|
96
|
+
|
97
|
+
ublic class CustomAdapter extends ArrayAdapter<MemberProfile> {
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
//CustomAdapterのコンストラクター
|
102
|
+
|
103
|
+
public CustomAdapter(Context context, List<MemberProfile> objects) {
|
104
|
+
|
105
|
+
super(context, R.layout.custom_list2, R.id.text, objects);
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
@Override
|
114
|
+
|
115
|
+
public View getView(int position, View convertView, ViewGroup parent) {
|
116
|
+
|
117
|
+
//カスタムレイアウトをviewの中で保持
|
118
|
+
|
119
|
+
View view = super.getView(position, convertView, parent);
|
120
|
+
|
121
|
+
TextView text = (TextView)view.findViewById(R.id.text);
|
122
|
+
|
123
|
+
TextView text2 = (TextView)view.findViewById(R.id.text2);
|
124
|
+
|
125
|
+
ImageView image = (ImageView) view.findViewById(R.id.image);
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
MemberProfile memberProfile = getItem(position);
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
//
|
134
|
+
|
135
|
+
text.setText(memberProfile.getName());
|
136
|
+
|
137
|
+
text2.setText(memberProfile.getJob());
|
138
|
+
|
139
|
+
image.setImageBitmap(memberProfile.getImage());
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
return view;
|
146
|
+
|
147
|
+
}
|
148
|
+
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
```
|