質問編集履歴

8

意図的な内容抹消の取り消し

2018/12/12 01:25

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1
+ クリアボタン押すといったん消えるがタッチすると再度表示されてしまう
test CHANGED
@@ -1 +1,441 @@
1
+ ```ここに言語を入力
2
+
3
+ コード
4
+
5
+ //Main.Activity.javaのコード
6
+
7
+ import android.os.Bundle;
8
+
9
+ import android.os.Environment;
10
+
11
+ import android.support.v7.app.AppCompatActivity;
12
+
13
+ import android.view.GestureDetector;
14
+
15
+ import android.view.Menu;
16
+
17
+ import android.view.MenuItem;
18
+
19
+ import android.view.MotionEvent;
20
+
21
+ import android.view.View;
22
+
23
+ import android.widget.Button;
24
+
25
+ import android.widget.ImageView;
26
+
27
+ import android.widget.TextView;
28
+
29
+ import java.io.BufferedWriter;
30
+
31
+ import java.io.FileWriter;
32
+
33
+ import java.io.PrintWriter;
34
+
35
+ public class MainActivity extends AppCompatActivity {
36
+
37
+ private StringBuffer info = new StringBuffer("Test onTouchEvent\n\n");
38
+
39
+ //テキストビュー
40
+
41
+ private TextView textView1;
42
+
43
+ private TextView textView2;
44
+
45
+ private TextView textView3;
46
+
47
+ private TextView textView4;
48
+
49
+ private ImageView imageView1;
50
+
51
+ private ImageView imageView2;
52
+
53
+ private ImageView imageView3;
54
+
55
+ private ImageView imageView4;
56
+
57
+ private ImageView imageView5;
58
+
59
+ private ImageView imageView6;
60
+
61
+ private ImageView imageView7;
62
+
63
+ private ImageView imageView8;
64
+
65
+ private ImageView imageView9;
66
+
67
+ private ImageView imageView10;
68
+
69
+ private int mcount;
70
+
71
+ // X軸最低スワイプ距離
72
+
73
+ private static final int SWIPE_MIN_DISTANCE = 300;
74
+
75
+ // X軸最低スワイプスピード
76
+
77
+ private static final int SWIPE_THRESHOLD_VELOCITY = 200;
78
+
79
+ // Y軸の移動距離 これ以上なら横移動を判定しない
80
+
81
+ private static final int SWIPE_MAX_OFF_PATH = 180;
82
+
83
+ // タッチイベントを処理するためのインタフェース
84
+
85
+ private GestureDetector mGestureDetector;
86
+
87
+ @Override
88
+
89
+ protected void onCreate(Bundle savedInstanceState) {
90
+
1
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
91
+ super.onCreate(savedInstanceState);
92
+
93
+ setContentView(R.layout.activity_main);
94
+
95
+ textView1 = findViewById(R.id.textView1);
96
+
97
+ textView2 = findViewById(R.id.textView2);
98
+
99
+ textView3 = findViewById(R.id.textView3);
100
+
101
+ imageView1 = findViewById(R.id.imageView1);
102
+
103
+ imageView2 = findViewById(R.id.imageView2);
104
+
105
+ imageView3 = findViewById(R.id.imageView3);
106
+
107
+ imageView4 = findViewById(R.id.imageView4);
108
+
109
+ imageView5 = findViewById(R.id.imageView5);
110
+
111
+ imageView6 = findViewById(R.id.imageView6);
112
+
113
+ imageView7 = findViewById(R.id.imageView7);
114
+
115
+ imageView8 = findViewById(R.id.imageView8);
116
+
117
+ imageView9 = findViewById(R.id.imageView9);
118
+
119
+ imageView10 = findViewById(R.id.imageView10);
120
+
121
+     //クリアボタンのイベント
122
+
123
+ Button button = findViewById(R.id.button);
124
+
125
+ button.setOnClickListener(new View.OnClickListener() {
126
+
127
+ @Override
128
+
129
+ public void onClick(View v) {
130
+
131
+ StringBuffer info = new StringBuffer("Test onTouchEvent\n\n");
132
+
133
+ textView1.setText(info);
134
+
135
+ }
136
+
137
+ });
138
+
139
+ }
140
+
141
+ //タッチイベント
142
+
143
+ @Override
144
+
145
+ public boolean onTouchEvent(MotionEvent event) {
146
+
147
+ switch (event.getAction()) {
148
+
149
+ case MotionEvent.ACTION_DOWN:
150
+
151
+ info.append("ACTION_DOWN\n");
152
+
153
+ info.append("Pressure");
154
+
155
+ info.append(event.getPressure());
156
+
157
+ info.append("\n");
158
+
159
+ info.append("x1:");
160
+
161
+ info.append(event.getX());
162
+
163
+ info.append("\n");
164
+
165
+ info.append("y1:");
166
+
167
+ info.append(event.getY());
168
+
169
+ info.append("\n\n");
170
+
171
+ break;
172
+
173
+ case MotionEvent.ACTION_UP:
174
+
175
+ info.append("ACTION_UP\n");
176
+
177
+ info.append("x2:");
178
+
179
+ info.append(event.getX());
180
+
181
+ info.append("\n");
182
+
183
+ info.append("y2:");
184
+
185
+ info.append(event.getY());
186
+
187
+ info.append("\n");
188
+
189
+ long eventDuration2 = event.getEventTime() - event.getDownTime();
190
+
191
+ info.append("duration: ");
192
+
193
+ info.append(eventDuration2);
194
+
195
+ info.append(" m/sec\n\n");
196
+
197
+ break;
198
+
199
+ case MotionEvent.ACTION_MOVE:
200
+
201
+ info.append("ACTION_MOVE\n");
202
+
203
+ break;
204
+
205
+ case MotionEvent.ACTION_CANCEL:
206
+
207
+ info.append("ACTION_CANCEL\n");
208
+
209
+ break;
210
+
211
+ }
212
+
213
+ textView1.setText(info);
214
+
215
+ return false;
216
+
217
+ }
218
+
219
+ }
220
+
221
+ ```
222
+
223
+ ```ここに言語を入力
224
+
225
+ //activity_main(レイアウトのコード)
226
+
227
+ <?xml version="1.0" encoding="utf-8"?>
228
+
229
+ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
230
+
231
+ xmlns:app="http://schemas.android.com/apk/res-auto"
232
+
233
+ android:layout_width="fill_parent"
234
+
235
+ android:layout_height="fill_parent"
236
+
237
+ android:orientation="vertical">
238
+
239
+ <Button
240
+
241
+ android:id="@+id/button"
242
+
243
+ android:text="@string/button"
244
+
245
+ android:layout_width="wrap_content"
246
+
247
+ android:layout_height="wrap_content" />
248
+
249
+ <TextView
250
+
251
+ android:id="@+id/textView1"
252
+
253
+ android:layout_width="wrap_content"
254
+
255
+ android:layout_height="wrap_content"
256
+
257
+ android:layout_marginStart="150dp" />
258
+
259
+ <TextView
260
+
261
+ android:id="@+id/textView2"
262
+
263
+ android:layout_width="wrap_content"
264
+
265
+ android:layout_height="wrap_content"
266
+
267
+ android:layout_marginStart="300dp"/>
268
+
269
+ <TextView
270
+
271
+ android:id="@+id/textView3"
272
+
273
+ android:layout_width="wrap_content"
274
+
275
+ android:layout_height="wrap_content"
276
+
277
+ android:layout_marginStart="400dp"/>
278
+
279
+ <ImageView
280
+
281
+ android:id="@+id/imageView1"
282
+
283
+ android:layout_width="100dp"
284
+
285
+ android:layout_height="100dp"
286
+
287
+ android:layout_marginStart="160dp"
288
+
289
+ android:layout_marginTop="130dp"
290
+
291
+ app:srcCompat="@android:drawable/alert_light_frame"
292
+
293
+ android:contentDescription="@string/todo"/>
294
+
295
+ <ImageView
296
+
297
+ android:id="@+id/imageView2"
298
+
299
+ android:layout_width="100dp"
300
+
301
+ android:layout_height="100dp"
302
+
303
+ android:layout_marginStart="160dp"
304
+
305
+ android:layout_marginTop="650dp"
306
+
307
+ app:srcCompat="@android:drawable/alert_light_frame"
308
+
309
+ android:contentDescription="@string/todo" />
310
+
311
+ <ImageView
312
+
313
+ android:id="@+id/imageView3"
314
+
315
+ android:layout_width="100dp"
316
+
317
+ android:layout_height="100dp"
318
+
319
+ android:layout_marginStart="330dp"
320
+
321
+ android:layout_marginTop="130dp"
322
+
323
+ app:srcCompat="@android:drawable/alert_light_frame"
324
+
325
+ android:contentDescription="@string/todo"/>
326
+
327
+ <ImageView
328
+
329
+ android:id="@+id/imageView4"
330
+
331
+ android:layout_width="100dp"
332
+
333
+ android:layout_height="100dp"
334
+
335
+ android:layout_marginStart="330dp"
336
+
337
+ android:layout_marginTop="650dp"
338
+
339
+ app:srcCompat="@android:drawable/alert_light_frame"
340
+
341
+ android:contentDescription="@string/todo"/>
342
+
343
+ <ImageView
344
+
345
+ android:id="@+id/imageView5"
346
+
347
+ android:layout_width="100dp"
348
+
349
+ android:layout_height="100dp"
350
+
351
+ android:layout_marginStart="450dp"
352
+
353
+ android:layout_marginTop="230dp"
354
+
355
+ app:srcCompat="@android:drawable/alert_light_frame"
356
+
357
+ android:contentDescription="@string/todo"/>
358
+
359
+ <ImageView
360
+
361
+ android:id="@+id/imageView6"
362
+
363
+ android:layout_width="100dp"
364
+
365
+ android:layout_height="100dp"
366
+
367
+ android:layout_marginStart="40dp"
368
+
369
+ android:layout_marginTop="230dp"
370
+
371
+ app:srcCompat="@android:drawable/alert_light_frame"
372
+
373
+ android:contentDescription="@string/todo"/>
374
+
375
+ <ImageView
376
+
377
+ android:id="@+id/imageView7"
378
+
379
+ android:layout_width="100dp"
380
+
381
+ android:layout_height="100dp"
382
+
383
+ android:layout_marginStart="40dp"
384
+
385
+ android:layout_marginTop="550dp"
386
+
387
+ app:srcCompat="@android:drawable/alert_light_frame"
388
+
389
+ android:contentDescription="@string/todo"/>
390
+
391
+ <ImageView
392
+
393
+ android:id="@+id/imageView8"
394
+
395
+ android:layout_width="100dp"
396
+
397
+ android:layout_height="100dp"
398
+
399
+ android:layout_marginStart="450dp"
400
+
401
+ android:layout_marginTop="550dp"
402
+
403
+ app:srcCompat="@android:drawable/alert_light_frame"
404
+
405
+ android:contentDescription="@string/todo"/>
406
+
407
+ <ImageView
408
+
409
+ android:id="@+id/imageView9"
410
+
411
+ android:layout_width="100dp"
412
+
413
+ android:layout_height="100dp"
414
+
415
+ android:layout_marginStart="10dp"
416
+
417
+ android:layout_marginTop="385dp"
418
+
419
+ app:srcCompat="@android:drawable/alert_light_frame"
420
+
421
+ android:contentDescription="@string/todo"/>
422
+
423
+ <ImageView
424
+
425
+ android:id="@+id/imageView10"
426
+
427
+ android:layout_width="100dp"
428
+
429
+ android:layout_height="100dp"
430
+
431
+ android:layout_marginStart="490dp"
432
+
433
+ android:layout_marginTop="385dp"
434
+
435
+ app:srcCompat="@android:drawable/alert_light_frame"
436
+
437
+ android:contentDescription="@string/todo"/>
438
+
439
+ </FrameLayout>
440
+
441
+ ```

7

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

2018/12/12 01:25

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- クリアボタン押すといったん消えるがタッチすると再度表示されてしまう
1
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
test CHANGED
@@ -1,529 +1 @@
1
- ```ここに言語を入力
2
-
3
- コード
4
-
5
-
6
-
7
- //Main.Activity.javaのコード
8
-
9
-
10
-
11
- import android.os.Bundle;
12
-
13
- import android.os.Environment;
14
-
15
- import android.support.v7.app.AppCompatActivity;
16
-
17
- import android.view.GestureDetector;
18
-
19
- import android.view.Menu;
20
-
21
- import android.view.MenuItem;
22
-
23
- import android.view.MotionEvent;
24
-
25
- import android.view.View;
26
-
27
- import android.widget.Button;
28
-
29
- import android.widget.ImageView;
30
-
31
- import android.widget.TextView;
32
-
33
- import java.io.BufferedWriter;
34
-
35
- import java.io.FileWriter;
36
-
37
- import java.io.PrintWriter;
38
-
39
-
40
-
41
- public class MainActivity extends AppCompatActivity {
42
-
43
- private StringBuffer info = new StringBuffer("Test onTouchEvent\n\n");
44
-
45
-
46
-
47
- //テキストビュー
48
-
49
- private TextView textView1;
50
-
51
- private TextView textView2;
52
-
53
- private TextView textView3;
54
-
55
- private TextView textView4;
56
-
57
- private ImageView imageView1;
58
-
59
- private ImageView imageView2;
60
-
61
- private ImageView imageView3;
62
-
63
- private ImageView imageView4;
64
-
65
- private ImageView imageView5;
66
-
67
- private ImageView imageView6;
68
-
69
- private ImageView imageView7;
70
-
71
- private ImageView imageView8;
72
-
73
- private ImageView imageView9;
74
-
75
- private ImageView imageView10;
76
-
77
-
78
-
79
- private int mcount;
80
-
81
- // X軸最低スワイプ距離
82
-
83
- private static final int SWIPE_MIN_DISTANCE = 300;
84
-
85
-
86
-
87
- // X軸最低スワイプスピード
88
-
89
- private static final int SWIPE_THRESHOLD_VELOCITY = 200;
90
-
91
-
92
-
93
- // Y軸の移動距離 これ以上なら横移動を判定しない
94
-
95
- private static final int SWIPE_MAX_OFF_PATH = 180;
96
-
97
-
98
-
99
- // タッチイベントを処理するためのインタフェース
100
-
101
- private GestureDetector mGestureDetector;
102
-
103
-
104
-
105
-
106
-
107
- @Override
108
-
109
- protected void onCreate(Bundle savedInstanceState) {
110
-
111
- super.onCreate(savedInstanceState);
1
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
112
-
113
- setContentView(R.layout.activity_main);
114
-
115
-
116
-
117
-
118
-
119
- textView1 = findViewById(R.id.textView1);
120
-
121
- textView2 = findViewById(R.id.textView2);
122
-
123
- textView3 = findViewById(R.id.textView3);
124
-
125
- imageView1 = findViewById(R.id.imageView1);
126
-
127
- imageView2 = findViewById(R.id.imageView2);
128
-
129
- imageView3 = findViewById(R.id.imageView3);
130
-
131
- imageView4 = findViewById(R.id.imageView4);
132
-
133
- imageView5 = findViewById(R.id.imageView5);
134
-
135
- imageView6 = findViewById(R.id.imageView6);
136
-
137
- imageView7 = findViewById(R.id.imageView7);
138
-
139
- imageView8 = findViewById(R.id.imageView8);
140
-
141
- imageView9 = findViewById(R.id.imageView9);
142
-
143
- imageView10 = findViewById(R.id.imageView10);
144
-
145
-
146
-
147
-     //クリアボタンのイベント
148
-
149
- Button button = findViewById(R.id.button);
150
-
151
- button.setOnClickListener(new View.OnClickListener() {
152
-
153
- @Override
154
-
155
- public void onClick(View v) {
156
-
157
- StringBuffer info = new StringBuffer("Test onTouchEvent\n\n");
158
-
159
- textView1.setText(info);
160
-
161
-
162
-
163
- }
164
-
165
- });
166
-
167
-
168
-
169
- }
170
-
171
- //タッチイベント
172
-
173
- @Override
174
-
175
- public boolean onTouchEvent(MotionEvent event) {
176
-
177
-
178
-
179
- switch (event.getAction()) {
180
-
181
- case MotionEvent.ACTION_DOWN:
182
-
183
-
184
-
185
- info.append("ACTION_DOWN\n");
186
-
187
- info.append("Pressure");
188
-
189
- info.append(event.getPressure());
190
-
191
- info.append("\n");
192
-
193
- info.append("x1:");
194
-
195
- info.append(event.getX());
196
-
197
- info.append("\n");
198
-
199
- info.append("y1:");
200
-
201
- info.append(event.getY());
202
-
203
- info.append("\n\n");
204
-
205
-
206
-
207
- break;
208
-
209
- case MotionEvent.ACTION_UP:
210
-
211
- info.append("ACTION_UP\n");
212
-
213
- info.append("x2:");
214
-
215
- info.append(event.getX());
216
-
217
- info.append("\n");
218
-
219
- info.append("y2:");
220
-
221
- info.append(event.getY());
222
-
223
- info.append("\n");
224
-
225
- long eventDuration2 = event.getEventTime() - event.getDownTime();
226
-
227
- info.append("duration: ");
228
-
229
- info.append(eventDuration2);
230
-
231
- info.append(" m/sec\n\n");
232
-
233
-
234
-
235
- break;
236
-
237
- case MotionEvent.ACTION_MOVE:
238
-
239
- info.append("ACTION_MOVE\n");
240
-
241
-
242
-
243
- break;
244
-
245
- case MotionEvent.ACTION_CANCEL:
246
-
247
- info.append("ACTION_CANCEL\n");
248
-
249
-
250
-
251
- break;
252
-
253
- }
254
-
255
-
256
-
257
- textView1.setText(info);
258
-
259
-
260
-
261
- return false;
262
-
263
-
264
-
265
- }
266
-
267
-
268
-
269
- }
270
-
271
-
272
-
273
- ```
274
-
275
- ```ここに言語を入力
276
-
277
- //activity_main(レイアウトのコード)
278
-
279
- <?xml version="1.0" encoding="utf-8"?>
280
-
281
-
282
-
283
- <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
284
-
285
- xmlns:app="http://schemas.android.com/apk/res-auto"
286
-
287
- android:layout_width="fill_parent"
288
-
289
- android:layout_height="fill_parent"
290
-
291
- android:orientation="vertical">
292
-
293
-
294
-
295
- <Button
296
-
297
- android:id="@+id/button"
298
-
299
- android:text="@string/button"
300
-
301
- android:layout_width="wrap_content"
302
-
303
- android:layout_height="wrap_content" />
304
-
305
-
306
-
307
- <TextView
308
-
309
- android:id="@+id/textView1"
310
-
311
- android:layout_width="wrap_content"
312
-
313
- android:layout_height="wrap_content"
314
-
315
- android:layout_marginStart="150dp" />
316
-
317
-
318
-
319
- <TextView
320
-
321
- android:id="@+id/textView2"
322
-
323
- android:layout_width="wrap_content"
324
-
325
- android:layout_height="wrap_content"
326
-
327
- android:layout_marginStart="300dp"/>
328
-
329
-
330
-
331
- <TextView
332
-
333
- android:id="@+id/textView3"
334
-
335
- android:layout_width="wrap_content"
336
-
337
- android:layout_height="wrap_content"
338
-
339
- android:layout_marginStart="400dp"/>
340
-
341
-
342
-
343
-
344
-
345
- <ImageView
346
-
347
- android:id="@+id/imageView1"
348
-
349
- android:layout_width="100dp"
350
-
351
- android:layout_height="100dp"
352
-
353
- android:layout_marginStart="160dp"
354
-
355
- android:layout_marginTop="130dp"
356
-
357
- app:srcCompat="@android:drawable/alert_light_frame"
358
-
359
- android:contentDescription="@string/todo"/>
360
-
361
-
362
-
363
- <ImageView
364
-
365
- android:id="@+id/imageView2"
366
-
367
- android:layout_width="100dp"
368
-
369
- android:layout_height="100dp"
370
-
371
- android:layout_marginStart="160dp"
372
-
373
- android:layout_marginTop="650dp"
374
-
375
- app:srcCompat="@android:drawable/alert_light_frame"
376
-
377
- android:contentDescription="@string/todo" />
378
-
379
-
380
-
381
- <ImageView
382
-
383
- android:id="@+id/imageView3"
384
-
385
- android:layout_width="100dp"
386
-
387
- android:layout_height="100dp"
388
-
389
- android:layout_marginStart="330dp"
390
-
391
- android:layout_marginTop="130dp"
392
-
393
- app:srcCompat="@android:drawable/alert_light_frame"
394
-
395
- android:contentDescription="@string/todo"/>
396
-
397
-
398
-
399
- <ImageView
400
-
401
- android:id="@+id/imageView4"
402
-
403
- android:layout_width="100dp"
404
-
405
- android:layout_height="100dp"
406
-
407
- android:layout_marginStart="330dp"
408
-
409
- android:layout_marginTop="650dp"
410
-
411
- app:srcCompat="@android:drawable/alert_light_frame"
412
-
413
- android:contentDescription="@string/todo"/>
414
-
415
-
416
-
417
- <ImageView
418
-
419
- android:id="@+id/imageView5"
420
-
421
- android:layout_width="100dp"
422
-
423
- android:layout_height="100dp"
424
-
425
- android:layout_marginStart="450dp"
426
-
427
- android:layout_marginTop="230dp"
428
-
429
- app:srcCompat="@android:drawable/alert_light_frame"
430
-
431
- android:contentDescription="@string/todo"/>
432
-
433
-
434
-
435
- <ImageView
436
-
437
- android:id="@+id/imageView6"
438
-
439
- android:layout_width="100dp"
440
-
441
- android:layout_height="100dp"
442
-
443
- android:layout_marginStart="40dp"
444
-
445
- android:layout_marginTop="230dp"
446
-
447
- app:srcCompat="@android:drawable/alert_light_frame"
448
-
449
- android:contentDescription="@string/todo"/>
450
-
451
-
452
-
453
- <ImageView
454
-
455
- android:id="@+id/imageView7"
456
-
457
- android:layout_width="100dp"
458
-
459
- android:layout_height="100dp"
460
-
461
- android:layout_marginStart="40dp"
462
-
463
- android:layout_marginTop="550dp"
464
-
465
- app:srcCompat="@android:drawable/alert_light_frame"
466
-
467
- android:contentDescription="@string/todo"/>
468
-
469
-
470
-
471
- <ImageView
472
-
473
- android:id="@+id/imageView8"
474
-
475
- android:layout_width="100dp"
476
-
477
- android:layout_height="100dp"
478
-
479
- android:layout_marginStart="450dp"
480
-
481
- android:layout_marginTop="550dp"
482
-
483
- app:srcCompat="@android:drawable/alert_light_frame"
484
-
485
- android:contentDescription="@string/todo"/>
486
-
487
-
488
-
489
- <ImageView
490
-
491
- android:id="@+id/imageView9"
492
-
493
- android:layout_width="100dp"
494
-
495
- android:layout_height="100dp"
496
-
497
- android:layout_marginStart="10dp"
498
-
499
- android:layout_marginTop="385dp"
500
-
501
- app:srcCompat="@android:drawable/alert_light_frame"
502
-
503
- android:contentDescription="@string/todo"/>
504
-
505
-
506
-
507
- <ImageView
508
-
509
- android:id="@+id/imageView10"
510
-
511
- android:layout_width="100dp"
512
-
513
- android:layout_height="100dp"
514
-
515
- android:layout_marginStart="490dp"
516
-
517
- android:layout_marginTop="385dp"
518
-
519
- app:srcCompat="@android:drawable/alert_light_frame"
520
-
521
- android:contentDescription="@string/todo"/>
522
-
523
-
524
-
525
- </FrameLayout>
526
-
527
-
528
-
529
- ```

6

あああああああああああああああああ

2018/12/05 11:02

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -8,10 +8,6 @@
8
8
 
9
9
 
10
10
 
11
- package com.example.yossy_yuto.flickevent2;
12
-
13
-
14
-
15
11
  import android.os.Bundle;
16
12
 
17
13
  import android.os.Environment;
@@ -531,19 +527,3 @@
531
527
 
532
528
 
533
529
  ```
534
-
535
-
536
-
537
- まだ途中ですがクリアボタンを押してもいったん消えるが画面をタッチすると再度消したものが表示されてしまいます。エラーは出ていません。どこが間違っているのでしょうか
538
-
539
- androidのバージョンは6.0.1なのでAPI levelは23を使っています.
540
-
541
-
542
-
543
- compileSdkVersion 28
544
-
545
- minSdkVersion 23
546
-
547
- targetSdkVersion 28
548
-
549
- をそれぞれ使っています

5

ファイルごとに分けました

2018/11/19 05:30

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -274,6 +274,10 @@
274
274
 
275
275
 
276
276
 
277
+ ```
278
+
279
+ ```ここに言語を入力
280
+
277
281
  //activity_main(レイアウトのコード)
278
282
 
279
283
  <?xml version="1.0" encoding="utf-8"?>
@@ -526,20 +530,10 @@
526
530
 
527
531
 
528
532
 
529
-
530
-
531
-
532
-
533
-
534
-
535
-
536
-
537
533
  ```
538
534
 
539
535
 
540
536
 
541
-
542
-
543
537
  まだ途中ですがクリアボタンを押してもいったん消えるが画面をタッチすると再度消したものが表示されてしまいます。エラーは出ていません。どこが間違っているのでしょうか
544
538
 
545
539
  androidのバージョンは6.0.1なのでAPI levelは23を使っています.

4

2018/10/06 04:32

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
File without changes

3

クリアボタンのイベントが書かれている部分に//クリアイベント と追加しました

2018/10/06 03:54

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -148,6 +148,8 @@
148
148
 
149
149
 
150
150
 
151
+     //クリアボタンのイベント
152
+
151
153
  Button button = findViewById(R.id.button);
152
154
 
153
155
  button.setOnClickListener(new View.OnClickListener() {

2

Androidについて追加しました

2018/10/04 07:58

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  コード
4
4
 
5
+
6
+
7
+ //Main.Activity.javaのコード
8
+
9
+
10
+
5
11
  package com.example.yossy_yuto.flickevent2;
6
12
 
7
13
 
@@ -266,6 +272,264 @@
266
272
 
267
273
 
268
274
 
275
+ //activity_main(レイアウトのコード)
276
+
277
+ <?xml version="1.0" encoding="utf-8"?>
278
+
279
+
280
+
281
+ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
282
+
283
+ xmlns:app="http://schemas.android.com/apk/res-auto"
284
+
285
+ android:layout_width="fill_parent"
286
+
287
+ android:layout_height="fill_parent"
288
+
289
+ android:orientation="vertical">
290
+
291
+
292
+
293
+ <Button
294
+
295
+ android:id="@+id/button"
296
+
297
+ android:text="@string/button"
298
+
299
+ android:layout_width="wrap_content"
300
+
301
+ android:layout_height="wrap_content" />
302
+
303
+
304
+
305
+ <TextView
306
+
307
+ android:id="@+id/textView1"
308
+
309
+ android:layout_width="wrap_content"
310
+
311
+ android:layout_height="wrap_content"
312
+
313
+ android:layout_marginStart="150dp" />
314
+
315
+
316
+
317
+ <TextView
318
+
319
+ android:id="@+id/textView2"
320
+
321
+ android:layout_width="wrap_content"
322
+
323
+ android:layout_height="wrap_content"
324
+
325
+ android:layout_marginStart="300dp"/>
326
+
327
+
328
+
329
+ <TextView
330
+
331
+ android:id="@+id/textView3"
332
+
333
+ android:layout_width="wrap_content"
334
+
335
+ android:layout_height="wrap_content"
336
+
337
+ android:layout_marginStart="400dp"/>
338
+
339
+
340
+
341
+
342
+
343
+ <ImageView
344
+
345
+ android:id="@+id/imageView1"
346
+
347
+ android:layout_width="100dp"
348
+
349
+ android:layout_height="100dp"
350
+
351
+ android:layout_marginStart="160dp"
352
+
353
+ android:layout_marginTop="130dp"
354
+
355
+ app:srcCompat="@android:drawable/alert_light_frame"
356
+
357
+ android:contentDescription="@string/todo"/>
358
+
359
+
360
+
361
+ <ImageView
362
+
363
+ android:id="@+id/imageView2"
364
+
365
+ android:layout_width="100dp"
366
+
367
+ android:layout_height="100dp"
368
+
369
+ android:layout_marginStart="160dp"
370
+
371
+ android:layout_marginTop="650dp"
372
+
373
+ app:srcCompat="@android:drawable/alert_light_frame"
374
+
375
+ android:contentDescription="@string/todo" />
376
+
377
+
378
+
379
+ <ImageView
380
+
381
+ android:id="@+id/imageView3"
382
+
383
+ android:layout_width="100dp"
384
+
385
+ android:layout_height="100dp"
386
+
387
+ android:layout_marginStart="330dp"
388
+
389
+ android:layout_marginTop="130dp"
390
+
391
+ app:srcCompat="@android:drawable/alert_light_frame"
392
+
393
+ android:contentDescription="@string/todo"/>
394
+
395
+
396
+
397
+ <ImageView
398
+
399
+ android:id="@+id/imageView4"
400
+
401
+ android:layout_width="100dp"
402
+
403
+ android:layout_height="100dp"
404
+
405
+ android:layout_marginStart="330dp"
406
+
407
+ android:layout_marginTop="650dp"
408
+
409
+ app:srcCompat="@android:drawable/alert_light_frame"
410
+
411
+ android:contentDescription="@string/todo"/>
412
+
413
+
414
+
415
+ <ImageView
416
+
417
+ android:id="@+id/imageView5"
418
+
419
+ android:layout_width="100dp"
420
+
421
+ android:layout_height="100dp"
422
+
423
+ android:layout_marginStart="450dp"
424
+
425
+ android:layout_marginTop="230dp"
426
+
427
+ app:srcCompat="@android:drawable/alert_light_frame"
428
+
429
+ android:contentDescription="@string/todo"/>
430
+
431
+
432
+
433
+ <ImageView
434
+
435
+ android:id="@+id/imageView6"
436
+
437
+ android:layout_width="100dp"
438
+
439
+ android:layout_height="100dp"
440
+
441
+ android:layout_marginStart="40dp"
442
+
443
+ android:layout_marginTop="230dp"
444
+
445
+ app:srcCompat="@android:drawable/alert_light_frame"
446
+
447
+ android:contentDescription="@string/todo"/>
448
+
449
+
450
+
451
+ <ImageView
452
+
453
+ android:id="@+id/imageView7"
454
+
455
+ android:layout_width="100dp"
456
+
457
+ android:layout_height="100dp"
458
+
459
+ android:layout_marginStart="40dp"
460
+
461
+ android:layout_marginTop="550dp"
462
+
463
+ app:srcCompat="@android:drawable/alert_light_frame"
464
+
465
+ android:contentDescription="@string/todo"/>
466
+
467
+
468
+
469
+ <ImageView
470
+
471
+ android:id="@+id/imageView8"
472
+
473
+ android:layout_width="100dp"
474
+
475
+ android:layout_height="100dp"
476
+
477
+ android:layout_marginStart="450dp"
478
+
479
+ android:layout_marginTop="550dp"
480
+
481
+ app:srcCompat="@android:drawable/alert_light_frame"
482
+
483
+ android:contentDescription="@string/todo"/>
484
+
485
+
486
+
487
+ <ImageView
488
+
489
+ android:id="@+id/imageView9"
490
+
491
+ android:layout_width="100dp"
492
+
493
+ android:layout_height="100dp"
494
+
495
+ android:layout_marginStart="10dp"
496
+
497
+ android:layout_marginTop="385dp"
498
+
499
+ app:srcCompat="@android:drawable/alert_light_frame"
500
+
501
+ android:contentDescription="@string/todo"/>
502
+
503
+
504
+
505
+ <ImageView
506
+
507
+ android:id="@+id/imageView10"
508
+
509
+ android:layout_width="100dp"
510
+
511
+ android:layout_height="100dp"
512
+
513
+ android:layout_marginStart="490dp"
514
+
515
+ android:layout_marginTop="385dp"
516
+
517
+ app:srcCompat="@android:drawable/alert_light_frame"
518
+
519
+ android:contentDescription="@string/todo"/>
520
+
521
+
522
+
523
+ </FrameLayout>
524
+
525
+
526
+
527
+
528
+
529
+
530
+
531
+
532
+
269
533
 
270
534
 
271
535
  ```
@@ -275,3 +539,15 @@
275
539
 
276
540
 
277
541
  まだ途中ですがクリアボタンを押してもいったん消えるが画面をタッチすると再度消したものが表示されてしまいます。エラーは出ていません。どこが間違っているのでしょうか
542
+
543
+ androidのバージョンは6.0.1なのでAPI levelは23を使っています.
544
+
545
+
546
+
547
+ compileSdkVersion 28
548
+
549
+ minSdkVersion 23
550
+
551
+ targetSdkVersion 28
552
+
553
+ をそれぞれ使っています

1

コードを```ではさみました

2018/10/04 07:55

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,7 @@
1
+ ```ここに言語を入力
2
+
3
+ コード
4
+
1
5
  package com.example.yossy_yuto.flickevent2;
2
6
 
3
7
 
@@ -262,4 +266,12 @@
262
266
 
263
267
 
264
268
 
269
+
270
+
271
+ ```
272
+
273
+
274
+
275
+
276
+
265
277
  まだ途中ですがクリアボタンを押してもいったん消えるが画面をタッチすると再度消したものが表示されてしまいます。エラーは出ていません。どこが間違っているのでしょうか