質問編集履歴
4
発生している問題・エラーメッセージ
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,11 +18,11 @@
|
|
18
18
|
|
19
19
|
###発生している問題・エラーメッセージ
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
アプリを起動してstartbuttonを押すと強制終了してしまいます。
|
22
|
+
|
23
|
+
Activity.classで"source code does not match the bytecode"とエラーが表示されました.
|
24
|
+
|
25
|
+
Method.classの public native Object invoke(Object var1, Object... var2) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException;と書かれた行にも同じように"source code does not match the bytecode"とエラーが表示されました.
|
26
26
|
|
27
27
|
###該当のソースコード
|
28
28
|
|
@@ -32,10 +32,6 @@
|
|
32
32
|
|
33
33
|
【MainActivity.java】
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
35
|
package com.example.oga_180114;
|
40
36
|
|
41
37
|
|
@@ -232,7 +228,7 @@
|
|
232
228
|
|
233
229
|
|
234
230
|
|
235
|
-
//
|
231
|
+
// 書き込みできるかチェック
|
236
232
|
|
237
233
|
if (isExternalStorageWritable()) {
|
238
234
|
|
@@ -246,8 +242,6 @@
|
|
246
242
|
|
247
243
|
+ "/" + fileName;
|
248
244
|
|
249
|
-
|
250
|
-
|
251
245
|
File file = new File(filePath);
|
252
246
|
|
253
247
|
|
@@ -294,7 +288,7 @@
|
|
294
288
|
|
295
289
|
public void run() {
|
296
290
|
|
297
|
-
//
|
291
|
+
// 処理をキューイング
|
298
292
|
|
299
293
|
handler.post(new Runnable() {
|
300
294
|
|
@@ -384,7 +378,7 @@
|
|
384
378
|
|
385
379
|
public void checkPermission() {
|
386
380
|
|
387
|
-
// 既に許可
|
381
|
+
// 既に許可
|
388
382
|
|
389
383
|
if (ActivityCompat.checkSelfPermission(this,
|
390
384
|
|
@@ -396,7 +390,7 @@
|
|
396
390
|
|
397
391
|
}
|
398
392
|
|
399
|
-
// 拒否
|
393
|
+
// 拒否
|
400
394
|
|
401
395
|
else{
|
402
396
|
|
@@ -426,20 +420,16 @@
|
|
426
420
|
|
427
421
|
Toast toast =
|
428
422
|
|
429
|
-
Toast.makeText(this, "
|
423
|
+
Toast.makeText(this, "許可が必要", Toast.LENGTH_SHORT);
|
430
424
|
|
431
425
|
toast.show();
|
432
426
|
|
433
|
-
|
434
|
-
|
435
427
|
ActivityCompat.requestPermissions(this,
|
436
428
|
|
437
429
|
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,},
|
438
430
|
|
439
431
|
REQUEST_PERMISSION);
|
440
432
|
|
441
|
-
|
442
|
-
|
443
433
|
}
|
444
434
|
|
445
435
|
}
|
@@ -464,7 +454,7 @@
|
|
464
454
|
|
465
455
|
} else {
|
466
456
|
|
467
|
-
//
|
457
|
+
// しかし拒否
|
468
458
|
|
469
459
|
Toast toast =
|
470
460
|
|
@@ -492,16 +482,8 @@
|
|
492
482
|
|
493
483
|
Sensor.TYPE_LINEAR_ACCELERATION);
|
494
484
|
|
495
|
-
|
496
|
-
|
497
485
|
sensorManager.registerListener(this, accel, SensorManager.SENSOR_DELAY_NORMAL);
|
498
486
|
|
499
|
-
//sensorManager.registerListener(this, accel, SensorManager.SENSOR_DELAY_FASTEST);
|
500
|
-
|
501
|
-
//sensorManager.registerListener(this, accel, SensorManager.SENSOR_DELAY_GAME);
|
502
|
-
|
503
|
-
//sensorManager.registerListener(this, accel, SensorManager.SENSOR_DELAY_UI);
|
504
|
-
|
505
487
|
}
|
506
488
|
|
507
489
|
|
@@ -556,11 +538,7 @@
|
|
556
538
|
|
557
539
|
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
558
540
|
|
559
|
-
|
560
|
-
|
561
|
-
}
|
541
|
+
}
|
562
|
-
|
563
|
-
|
564
542
|
|
565
543
|
}
|
566
544
|
|
@@ -578,8 +556,6 @@
|
|
578
556
|
|
579
557
|
問題があると考えています。
|
580
558
|
|
581
|
-
しかし、具体的に何が原因となっていて、どのように修正したらよいのか分からない状況です。
|
582
|
-
|
583
559
|
|
584
560
|
|
585
561
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
3
ソースコードを ```で挟んだ
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
###前提・実現したいこと
|
2
2
|
|
3
|
-
|
4
|
-
|
5
3
|
Androidで加速度センサ値を定期的にテキストファイルに書き込むプログラムを作成しています。
|
6
4
|
|
7
5
|
・システムの流れ
|
@@ -28,6 +26,10 @@
|
|
28
26
|
|
29
27
|
###該当のソースコード
|
30
28
|
|
29
|
+
|
30
|
+
|
31
|
+
```ここに言語を入力
|
32
|
+
|
31
33
|
【MainActivity.java】
|
32
34
|
|
33
35
|
|
@@ -562,6 +564,10 @@
|
|
562
564
|
|
563
565
|
}
|
564
566
|
|
567
|
+
```
|
568
|
+
|
569
|
+
|
570
|
+
|
565
571
|
|
566
572
|
|
567
573
|
###試したこと
|
2
誤字修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
|
36
36
|
|
37
|
-
package com.example.oga
|
37
|
+
package com.example.oga_180114;
|
38
38
|
|
39
39
|
|
40
40
|
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|