質問編集履歴
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -40,7 +40,6 @@
|
|
40
40
|
if(event.getAction() == MotionEvent.ACTION_DOWN) {
|
41
41
|
//押したときの動作
|
42
42
|
imageView.setImageResource(R.drawable.ossantapped);
|
43
|
-
soundPool.play(soundOne, 1.0f, 1.0f, 0, 0, 1);
|
44
43
|
} else if (event.getAction() == MotionEvent.ACTION_UP) {
|
45
44
|
//離したときの動作
|
46
45
|
imageView.setImageResource(R.drawable.ossan);
|
1
追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -27,4 +27,28 @@
|
|
27
27
|
の変化を繰り返したい
|
28
28
|
|
29
29
|
|
30
|
-
forとかwhileを使うといいのでしょうか?
|
30
|
+
forとかwhileを使うといいのでしょうか?
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
追記
|
35
|
+
|
36
|
+
```ここに言語を入力
|
37
|
+
imageView.setOnTouchListener(new View.OnTouchListener() {
|
38
|
+
@Override
|
39
|
+
public boolean onTouch(View v, MotionEvent event){
|
40
|
+
if(event.getAction() == MotionEvent.ACTION_DOWN) {
|
41
|
+
//押したときの動作
|
42
|
+
imageView.setImageResource(R.drawable.ossantapped);
|
43
|
+
soundPool.play(soundOne, 1.0f, 1.0f, 0, 0, 1);
|
44
|
+
} else if (event.getAction() == MotionEvent.ACTION_UP) {
|
45
|
+
//離したときの動作
|
46
|
+
imageView.setImageResource(R.drawable.ossan);
|
47
|
+
|
48
|
+
}
|
49
|
+
return false;
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
});
|
54
|
+
```
|