質問編集履歴

16

2016/06/03 11:07

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -240,6 +240,8 @@
240
240
 
241
241
  ```を追加してみましたが、変わりませんでした。
242
242
 
243
+ ※yonaさんの意見により、performClickメソッドは、削除しました。
244
+
243
245
 
244
246
 
245
247
  ###logcat

15

編集

2016/06/03 11:07

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -478,6 +478,8 @@
478
478
 
479
479
  ```
480
480
 
481
+ 解決につながることを願います。
482
+
481
483
 
482
484
 
483
485
  ###補足情報(環境)

14

訂正

2016/06/03 09:12

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -292,7 +292,9 @@
292
292
 
293
293
 
294
294
 
295
+ ```
296
+
295
- ```package jp.co.hokkaido.nakafurano.hideo.kodama.vulkan;
297
+ package jp.co.hokkaido.nakafurano.hideo.kodama.vulkan;
296
298
 
297
299
 
298
300
 
@@ -472,7 +474,9 @@
472
474
 
473
475
  }
474
476
 
477
+ }
478
+
475
- }```
479
+ ```
476
480
 
477
481
 
478
482
 

13

編集

2016/06/03 09:11

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -276,7 +276,9 @@
276
276
 
277
277
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:741)
278
278
 
279
- at dalvik.system.NativeStart.main(Native Method) ```
279
+ at dalvik.system.NativeStart.main(Native Method)
280
+
281
+ ```
280
282
 
281
283
 
282
284
 

12

追加

2016/06/03 09:10

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -276,7 +276,7 @@
276
276
 
277
277
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:741)
278
278
 
279
- at dalvik.system.NativeStart.main(Native Method)
279
+ at dalvik.system.NativeStart.main(Native Method) ```
280
280
 
281
281
 
282
282
 

11

特になし

2016/06/03 09:09

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
File without changes

10

改行

2016/06/03 09:04

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -284,8 +284,12 @@
284
284
 
285
285
  ###NullPointerExceptionについて(SelectActivity.java)
286
286
 
287
+
288
+
287
289
  yonaさんのご指摘により、SelectActivityの56行目でNullPointerExceptionが発生しているようなので、コードを掲載しておきます。
288
290
 
291
+
292
+
289
293
  ```package jp.co.hokkaido.nakafurano.hideo.kodama.vulkan;
290
294
 
291
295
 
@@ -466,9 +470,7 @@
466
470
 
467
471
  }
468
472
 
469
- }
470
-
471
- ```
473
+ }```
472
474
 
473
475
 
474
476
 

9

誤字

2016/06/03 09:03

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -276,7 +276,7 @@
276
276
 
277
277
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:741)
278
278
 
279
- at dalvik.system.NativeStart.main(Native Method) ```
279
+ at dalvik.system.NativeStart.main(Native Method)
280
280
 
281
281
 
282
282
 

8

改行

2016/06/03 09:02

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -280,6 +280,8 @@
280
280
 
281
281
 
282
282
 
283
+
284
+
283
285
  ###NullPointerExceptionについて(SelectActivity.java)
284
286
 
285
287
  yonaさんのご指摘により、SelectActivityの56行目でNullPointerExceptionが発生しているようなので、コードを掲載しておきます。

7

編集

2016/06/03 09:01

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -276,7 +276,7 @@
276
276
 
277
277
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:741)
278
278
 
279
- at dalvik.system.NativeStart.main(Native Method)```
279
+ at dalvik.system.NativeStart.main(Native Method) ```
280
280
 
281
281
 
282
282
 

6

特になし

2016/06/03 09:00

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -282,8 +282,6 @@
282
282
 
283
283
  ###NullPointerExceptionについて(SelectActivity.java)
284
284
 
285
-
286
-
287
285
  yonaさんのご指摘により、SelectActivityの56行目でNullPointerExceptionが発生しているようなので、コードを掲載しておきます。
288
286
 
289
287
  ```package jp.co.hokkaido.nakafurano.hideo.kodama.vulkan;

5

SelectActivity\.javaのコード掲載

2016/06/03 08:59

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -148,7 +148,7 @@
148
148
 
149
149
  if (touchAction == MotionEvent.ACTION_DOWN) {
150
150
 
151
- getContext().startActivity(new Intent(getContext(), NextActivity.class));
151
+ getContext().startActivity(new Intent(getContext(), SelectView.class));
152
152
 
153
153
 
154
154
 
@@ -244,51 +244,7 @@
244
244
 
245
245
  ###logcat
246
246
 
247
- ```06-02 18:36:51.697 3772-20292/? E/ClientConnectionOperation﹕ Handling ConnectionFailedException
248
-
249
- com.google.android.gms.drive.api.a.r: Unable to resolve account name.
250
-
251
- at com.google.android.gms.drive.api.a.q.a(:com.google.android.gms:71)
252
-
253
- at com.google.android.gms.common.service.f.run(:com.google.android.gms:176)
254
-
255
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
256
-
257
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
258
-
259
- at com.google.android.gms.common.util.a.c.run(:com.google.android.gms:17)
260
-
261
- at java.lang.Thread.run(Thread.java:856)
247
+ ```
262
-
263
- 06-02 18:36:55.247 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
264
-
265
- 06-02 18:36:55.247 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
266
-
267
- 06-02 18:36:57.817 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
268
-
269
- 06-02 18:36:57.817 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
270
-
271
- 06-02 18:37:00.377 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
272
-
273
- 06-02 18:37:00.377 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
274
-
275
- 06-02 18:37:01.717 3772-20298/? E/ClientConnectionOperation﹕ Handling ConnectionFailedException
276
-
277
- com.google.android.gms.drive.api.a.r: Unable to resolve account name.
278
-
279
- at com.google.android.gms.drive.api.a.q.a(:com.google.android.gms:71)
280
-
281
- at com.google.android.gms.common.service.f.run(:com.google.android.gms:176)
282
-
283
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
284
-
285
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
286
-
287
- at com.google.android.gms.common.util.a.c.run(:com.google.android.gms:17)
288
-
289
- at java.lang.Thread.run(Thread.java:856)
290
-
291
- 06-02 18:37:02.937 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
292
248
 
293
249
  Caused by: java.lang.NullPointerException
294
250
 
@@ -324,7 +280,195 @@
324
280
 
325
281
 
326
282
 
327
-
283
+ ###NullPointerExceptionについて(SelectActivity.java)
284
+
285
+
286
+
287
+ yonaさんのご指摘により、SelectActivityの56行目でNullPointerExceptionが発生しているようなので、コードを掲載しておきます。
288
+
289
+ ```package jp.co.hokkaido.nakafurano.hideo.kodama.vulkan;
290
+
291
+
292
+
293
+ import android.app.Activity;
294
+
295
+ import android.content.Intent;
296
+
297
+ import android.content.res.Resources;
298
+
299
+ import android.graphics.Bitmap;
300
+
301
+ import android.graphics.BitmapFactory;
302
+
303
+ import android.graphics.Color;
304
+
305
+ import android.graphics.Point;
306
+
307
+ import android.os.Bundle;
308
+
309
+ import android.support.annotation.Nullable;
310
+
311
+ import android.view.Display;
312
+
313
+ import android.view.View;
314
+
315
+ import android.view.Window;
316
+
317
+ import android.view.WindowManager;
318
+
319
+ import android.widget.ImageButton;
320
+
321
+ import android.widget.LinearLayout;
322
+
323
+ import android.view.ViewGroup.LayoutParams;
324
+
325
+ import android.view.ViewGroup.MarginLayoutParams;
326
+
327
+
328
+
329
+ /**
330
+
331
+ * Created by hidemaru on 2016/03/25.
332
+
333
+ */
334
+
335
+ public class SelectActivity extends Activity {
336
+
337
+ @Override
338
+
339
+ protected void onCreate(Bundle bundle){
340
+
341
+ super.onCreate(bundle);
342
+
343
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
344
+
345
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
346
+
347
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
348
+
349
+
350
+
351
+ Display display = this.getWindowManager().getDefaultDisplay();
352
+
353
+ Point p = new Point();
354
+
355
+ display.getSize(p);
356
+
357
+
358
+
359
+ LinearLayout linearLayout = new LinearLayout(this);
360
+
361
+ linearLayout.setOrientation(LinearLayout.VERTICAL);
362
+
363
+ linearLayout.setBackgroundColor(Color.argb(255, 100, 149, 237));
364
+
365
+
366
+
367
+ ImageButton imgMap = new ImageButton(this);
368
+
369
+ ImageButton imgLive = new ImageButton(this);
370
+
371
+ ImageButton imgAVS = new ImageButton(this);
372
+
373
+
374
+
375
+ Resources r = getResources();
376
+
377
+ Bitmap bmpM = BitmapFactory.decodeResource(r, R.drawable.vutton0);
378
+
379
+ imgMap.setImageBitmap(bmpM);
380
+
381
+ imgMap.setOnClickListener(new View.OnClickListener() {
382
+
383
+ @Override
384
+
385
+ public void onClick(View view) {
386
+
387
+ Intent intent = new Intent(SelectActivity.this,VolMap.class);
388
+
389
+ startActivity(intent);
390
+
391
+ }
392
+
393
+ });
394
+
395
+ LayoutParams lp = imgMap.getLayoutParams();
396
+
397
+ MarginLayoutParams mlpM = (MarginLayoutParams)lp;
398
+
399
+ mlpM.setMargins((p.x-60)/2,(p.y-272*3)/4,(p.x-60)/2,0);
400
+
401
+ imgMap.setLayoutParams(mlpM);
402
+
403
+ linearLayout.addView(imgMap);
404
+
405
+ //TODO continue this proccess
406
+
407
+
408
+
409
+ Resources r2 = getResources();
410
+
411
+ Bitmap bmpL = BitmapFactory.decodeResource(r2, R.drawable.vutton1);
412
+
413
+ imgLive.setImageBitmap(bmpL);
414
+
415
+ imgLive.setOnClickListener(new View.OnClickListener() {
416
+
417
+ @Override
418
+
419
+ public void onClick(View view) {
420
+
421
+ Intent intent = new Intent(SelectActivity.this,LiveCameraActivity.class);
422
+
423
+ startActivity(intent);
424
+
425
+ }
426
+
427
+ });
428
+
429
+ LayoutParams lp2 = imgLive.getLayoutParams();
430
+
431
+ MarginLayoutParams mlpL = (MarginLayoutParams)lp2;
432
+
433
+ mlpL.setMargins((p.x-60)/2,(p.y-272*3)/4,(p.x-60)/2,0);
434
+
435
+ imgLive.setLayoutParams(mlpL);
436
+
437
+ linearLayout.addView(imgLive);
438
+
439
+
440
+
441
+ Resources r3 = getResources();
442
+
443
+ Bitmap bmpA = BitmapFactory.decodeResource(r3,R.drawable.vutton2);
444
+
445
+ imgAVS.setImageBitmap(bmpA);
446
+
447
+ imgAVS.setOnClickListener(new View.OnClickListener() {
448
+
449
+ @Override
450
+
451
+ public void onClick(View view) {
452
+
453
+ }
454
+
455
+ });
456
+
457
+ LayoutParams lp3 = imgAVS.getLayoutParams();
458
+
459
+ MarginLayoutParams mlpA = (MarginLayoutParams)lp3;
460
+
461
+ mlpA.setMargins((p.x-60)/2,(p.y-272*3)/4,(p.x-60)/2,0);
462
+
463
+ imgAVS.setLayoutParams(mlpA);
464
+
465
+ linearLayout.addView(imgAVS);
466
+
467
+ }
468
+
469
+ }
470
+
471
+ ```
328
472
 
329
473
 
330
474
 

4

logcat追加

2016/06/03 08:57

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -288,7 +288,39 @@
288
288
 
289
289
  at java.lang.Thread.run(Thread.java:856)
290
290
 
291
- 06-02 18:37:02.937 740-740/? E/Parcel﹕ Reading a NULL string not supported here.```
291
+ 06-02 18:37:02.937 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
292
+
293
+ Caused by: java.lang.NullPointerException
294
+
295
+ at jp.co.hokkaido.nakafurano.hideo.kodama.vulkan.SelectActivity.onCreate(SelectActivity.java:55)
296
+
297
+ at android.app.Activity.performCreate(Activity.java:5104)
298
+
299
+ at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
300
+
301
+ at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2193)
302
+
303
+ at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2310)
304
+
305
+ at android.app.ActivityThread.access$600(ActivityThread.java:169)
306
+
307
+ at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1274)
308
+
309
+ at android.os.Handler.dispatchMessage(Handler.java:99)
310
+
311
+ at android.os.Looper.loop(Looper.java:137)
312
+
313
+ at android.app.ActivityThread.main(ActivityThread.java:5323)
314
+
315
+ at java.lang.reflect.Method.invokeNative(Native Method)
316
+
317
+ at java.lang.reflect.Method.invoke(Method.java:511)
318
+
319
+ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:974)
320
+
321
+ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:741)
322
+
323
+ at dalvik.system.NativeStart.main(Native Method)```
292
324
 
293
325
 
294
326
 

3

logcatを追加

2016/06/03 07:58

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -242,6 +242,60 @@
242
242
 
243
243
 
244
244
 
245
+ ###logcat
246
+
247
+ ```06-02 18:36:51.697 3772-20292/? E/ClientConnectionOperation﹕ Handling ConnectionFailedException
248
+
249
+ com.google.android.gms.drive.api.a.r: Unable to resolve account name.
250
+
251
+ at com.google.android.gms.drive.api.a.q.a(:com.google.android.gms:71)
252
+
253
+ at com.google.android.gms.common.service.f.run(:com.google.android.gms:176)
254
+
255
+ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
256
+
257
+ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
258
+
259
+ at com.google.android.gms.common.util.a.c.run(:com.google.android.gms:17)
260
+
261
+ at java.lang.Thread.run(Thread.java:856)
262
+
263
+ 06-02 18:36:55.247 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
264
+
265
+ 06-02 18:36:55.247 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
266
+
267
+ 06-02 18:36:57.817 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
268
+
269
+ 06-02 18:36:57.817 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
270
+
271
+ 06-02 18:37:00.377 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
272
+
273
+ 06-02 18:37:00.377 740-740/? E/Parcel﹕ Reading a NULL string not supported here.
274
+
275
+ 06-02 18:37:01.717 3772-20298/? E/ClientConnectionOperation﹕ Handling ConnectionFailedException
276
+
277
+ com.google.android.gms.drive.api.a.r: Unable to resolve account name.
278
+
279
+ at com.google.android.gms.drive.api.a.q.a(:com.google.android.gms:71)
280
+
281
+ at com.google.android.gms.common.service.f.run(:com.google.android.gms:176)
282
+
283
+ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
284
+
285
+ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
286
+
287
+ at com.google.android.gms.common.util.a.c.run(:com.google.android.gms:17)
288
+
289
+ at java.lang.Thread.run(Thread.java:856)
290
+
291
+ 06-02 18:37:02.937 740-740/? E/Parcel﹕ Reading a NULL string not supported here.```
292
+
293
+
294
+
295
+
296
+
297
+
298
+
245
299
  ###補足情報(環境)
246
300
 
247
301
  OS OSX Yosemite 10.10.5

2

2016/06/02 09:57

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- ###Androidアプリデバッグしていたら、「問題が発生したため、○○○○を終了します」と表示される。
1
+ ###Androidアプリを実機でデバッグしていたら、「問題が発生したため、○○○○を終了します」と表示される。
2
2
 
3
3
  JavaでAndroidアプリを開発しているのですが、カスタムビューでタッチイベントを受け取って、Intentを投げるプログラムをかいてデバッグしたところ、「問題が発生したため、○○○○を終了します」と表示されて、終了してしまうのですが、どうしたらよいでしょうか。
4
4
 

1

2016/06/02 09:20

投稿

hidemaru
hidemaru

スコア30

test CHANGED
File without changes
test CHANGED
File without changes