質問編集履歴

2

2016/03/30 09:23

投稿

masaakitsuyoshi
masaakitsuyoshi

スコア102

test CHANGED
@@ -1 +1 @@
1
- Bundleの値の受け取り方
1
+ Bundleの値の受け取り方
test CHANGED
@@ -136,6 +136,8 @@
136
136
 
137
137
 
138
138
 
139
+ 追記
140
+
139
141
 
140
142
 
141
143
  ```ここに言語を入力

1

追記

2016/03/30 09:23

投稿

masaakitsuyoshi
masaakitsuyoshi

スコア102

test CHANGED
File without changes
test CHANGED
@@ -133,3 +133,115 @@
133
133
 
134
134
 
135
135
  ```
136
+
137
+
138
+
139
+
140
+
141
+ ```ここに言語を入力
142
+
143
+ public class SubActivity extends AppCompatActivity{
144
+
145
+ @Override
146
+
147
+ public void onCreate(Bundle savedInstanceState) {
148
+
149
+ super.onCreate(savedInstanceState);
150
+
151
+ setContentView(R.layout.sub_activity);
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+ TextView text = (TextView) findViewById(R.id.textView);
160
+
161
+ TextView text2 = (TextView) findViewById(R.id.textView2);
162
+
163
+ TextView text3 = (TextView) findViewById(R.id.textView3);
164
+
165
+ ImageView imageView = (ImageView) findViewById(R.id.imageView);
166
+
167
+
168
+
169
+ Intent sub = getIntent();
170
+
171
+
172
+
173
+
174
+
175
+ String name = sub.getStringExtra("list_names");
176
+
177
+ String job = sub.getStringExtra("list_jobs");
178
+
179
+ int image = sub.getParcelableExtra("list_images");
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ text.setText(name);
188
+
189
+ text2.setText(job);
190
+
191
+ imageView.setImageResource(image);
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+ }
200
+
201
+
202
+
203
+
204
+
205
+ }
206
+
207
+ ```
208
+
209
+ ```ここに言語を入力
210
+
211
+ listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
212
+
213
+ @Override
214
+
215
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
216
+
217
+
218
+
219
+ MemberProfile memberProfile = (MemberProfile)listView.getItemAtPosition(position);
220
+
221
+
222
+
223
+ Intent sub = new Intent();
224
+
225
+ sub.putExtra("list_names", memberProfile.getName());
226
+
227
+ sub.putExtra("list_jobs",memberProfile.getJob());
228
+
229
+ sub.putExtra("list_images",memberProfile.getImage());
230
+
231
+
232
+
233
+
234
+
235
+ sub.setClassName("com.example.tsuyoshiokaprofile", "com.example.tsuyoshiokaprofile.SubActivity");
236
+
237
+ startActivity(sub);
238
+
239
+
240
+
241
+ }
242
+
243
+ });
244
+
245
+
246
+
247
+ ```