Hello all,
I have a problem. I use Click and Long Click Event in a button.
Everything's seems fine. However; whenever a user long click the
button, the click event also triggers. I couldn't find what I am doing
wrong. On the other hand, I noticed something might highly relevant
showDialog function returns before the user selects in the popup menu.
this is the long click function:
@Override
public boolean onLongClick(View view) {
if(SMBGuesstheNumber.bDisplayFlagList)
{
theActiveButton = (Button) view;
showDialog(R.id.display_flaglist);
}
return false;
}
and this is the dialog handler:
case R.id.display_flaglist:
AlertDialog listdialog = new AlertDialog.Builder
(GfxGuesstheNumber.this)
.setIcon(R.drawable.droid)
.setTitle(R.string.dialog_flaglist)
.setItems(R.array.entries_flaglist, new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int
whichButton) {
switch(whichButton){
case 0:
theActiveButton.setTextColor(Color.BLACK);
break;
case 1:
theActiveButton.setTextColor(Color.GREEN);
break;
case 2:
theActiveButton.setTextColor(Color.YELLOW);
break;
case 3:
theActiveButton.setTextColor(Color.RED);
break;
}
}
})
.create();
return listdialog;
Any comment will be helpful.
Thank you,
Omer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---