You can change the mButton that is in your place. And you can add paranthesis after if and else if
mButton.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) Log.d("Pressed", "Button pressed"); else if (event.getAction() == MotionEvent.ACTION_UP) Log.d("Released", "Button released");
And this code from:
// butona basınca bir ses çekince bir ses geliyor. sescal.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { Log.d("Pressed", "Button pressed"); mp.start(); } else if (event.getAction() == MotionEvent.ACTION_UP) { Log.d("Released", "Button released"); mp2.start(); } // TODO Auto-generated method stub return false; } });
Bay
source share