質問編集履歴

4

Activity内で画面遷移を行うプログラムに関しての追記です。

2018/05/23 13:42

投稿

kamanuma
kamanuma

スコア4

test CHANGED
File without changes
test CHANGED
@@ -215,3 +215,141 @@
215
215
  デバッグ用端末はTORUQUE g01
216
216
 
217
217
  Androidバージョンは4.4.2です。
218
+
219
+
220
+
221
+
222
+
223
+ ※以下が追記内容となります。
224
+
225
+
226
+
227
+ 同Activity内分岐処理----------------------------
228
+
229
+
230
+
231
+ private void setScreenContent(int screenId) {
232
+
233
+ mScreenId = screenId;
234
+
235
+ setContentView(screenId);
236
+
237
+
238
+
239
+ switch (screenId) {
240
+
241
+
242
+
243
+ case R.layout.range_select: {
244
+
245
+ setMainScreenContent();
246
+
247
+ break;
248
+
249
+ }
250
+
251
+ case R.layout.chart_create: {
252
+
253
+ setChartCreate();
254
+
255
+ break;
256
+
257
+ }
258
+
259
+ }
260
+
261
+ }
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+ グラフ表示ボタン関連xml----------------------------
270
+
271
+
272
+
273
+ <?xml version="1.0" encoding="utf-8"?>
274
+
275
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
276
+
277
+ android:orientation="horizontal"
278
+
279
+ android:layout_width="fill_parent"
280
+
281
+ android:layout_height="wrap_content"
282
+
283
+ >
284
+
285
+
286
+
287
+ <Button
288
+
289
+ android:id="@+id/do_reset"
290
+
291
+ android:layout_width="0dip"
292
+
293
+ android:layout_height="wrap_content"
294
+
295
+ android:layout_weight="1"
296
+
297
+ android:text="Reset"
298
+
299
+ />
300
+
301
+
302
+
303
+ <Button
304
+
305
+ android:id="@+id/do_calc"
306
+
307
+ android:layout_width="0dip"
308
+
309
+ android:layout_height="wrap_content"
310
+
311
+ android:layout_weight="1"
312
+
313
+ android:text="Calculate"
314
+
315
+ />
316
+
317
+
318
+
319
+ <Button
320
+
321
+ android:id="@+id/pie_chart"
322
+
323
+ android:layout_width="0dip"
324
+
325
+ android:layout_height="wrap_content"
326
+
327
+ android:layout_weight="1"
328
+
329
+ android:text="Chart"
330
+
331
+ />
332
+
333
+
334
+
335
+ </LinearLayout>
336
+
337
+
338
+
339
+ ------------------------------------------------
340
+
341
+
342
+
343
+ ボタン押下時に補足情報の最初に記載してあるsetChartCreateメソッドを呼び出し
344
+
345
+ 「該当のソースコード」欄に記載してある処理に入り
346
+
347
+
348
+
349
+ mPieChart = findViewById(R.id.pie_chart);
350
+
351
+
352
+
353
+ 行からエラーという流れです。
354
+
355
+ よろしくお願いします。

3

2018/05/23 13:42

投稿

kamanuma
kamanuma

スコア4

test CHANGED
File without changes
test CHANGED
@@ -209,3 +209,9 @@
209
209
  });
210
210
 
211
211
 
212
+
213
+
214
+
215
+ デバッグ用端末はTORUQUE g01
216
+
217
+ Androidバージョンは4.4.2です。

2

2018/05/22 18:05

投稿

kamanuma
kamanuma

スコア4

test CHANGED
File without changes
test CHANGED
File without changes

1

2018/05/22 18:02

投稿

kamanuma
kamanuma

スコア4

test CHANGED
File without changes
test CHANGED
@@ -16,6 +16,8 @@
16
16
 
17
17
 
18
18
 
19
+ グラフ画面遷移ボタンを押下すると発生します。
20
+
19
21
 
20
22
 
21
23
  05-23 01:49:19.593 30797-30797/com.example.test_ttcalc I/System.out: Debugger has connected
@@ -205,3 +207,5 @@
205
207
  }
206
208
 
207
209
  });
210
+
211
+