Hi everyone,
I'm trying to add an OnClickListener and an OnTouchListener on a
button. However when I add the OnClickListener on the button it
works.
Whenever I add the OnTouchListener to the button with the
OnCLickListener, none of them works. Here is the code:
final Button a=new Button(this);
a.setLayoutParams(new
AbsoluteLayout.LayoutParams
(-2,-2,lastxposition,lastyposition));
a.setText("Button");
a.setOnClickListener(new View.OnClickListener
()
{
@Override
public void onClick(View v) {
openFiles
();
}
});
a.setOnTouchListener(new View.OnTouchListener
()
{
@Override
public boolean onTouch(View v, MotionEvent
event) {
String tagname=(String) a.getText();
findID(tagname);
return true;
}
});
Can anybody tell me what I do wrong here?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---