d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Android Java Drag And Drop Without The Dragging?
Prev123
Add Reply New Topic New Poll
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
May 1 2015 05:26pm
Quote (iGotThatFiyah @ May 1 2015 02:45pm)
is there another way to allow the user to click a box only once besides what i'm doing in the following code? or is my method good enough?
box1_clicked is a boolean initialized to false..basically a flag to indicate the box has been clicked.

Code
public void onClick(View view) {

if (view == box1_view && !box1_clicked) {
box1_clicked = true;
....


have you considered simply removing the event listener the first time it fires?
Go Back To Programming & Development Topic List
Prev123
Add Reply New Topic New Poll