When I first created my GUI "buttons" I set OnClickListeners for each of them. When I ran the app on my actual phone, I didn't like how the action was performed when the user "releases" the button, instead of acting immeadiately upon pressing. So I switched to OnTouchListeners. The problem that I am having now is that as long as I hold the button down it performs the action over and over, when I only want it to happen once. Any Ideas?
Heres one of my OnTouchListener segments:
});
Heres one of my OnTouchListener segments:
button01.setOnTouchListener(
new View.OnTouchListener()
{
@Override
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
if(check)
{
vibe.vibrate(vib);
SwitchIt(1);
moves++;
DrawIt();
IsClear();
check = false;
return true;
}
check = true;
return true;
}
{
if(check)
{
vibe.vibrate(vib);
SwitchIt(1);
moves++;
DrawIt();
IsClear();
check = false;
return true;
}
check = true;
return true;
}
});