android - Can't get onTouchListener to fire -


i'm trying touch listener fire, can't make work. see doing wrong? thanks!

public class findeventsactivity extends activity implements locationlistener, ontouchlistener {      //lots of other code here      private void getfromcitystate() {          layoutinflater inflater = layoutinflater.from(this);         view view = inflater.inflate(r.layout.city_state_entry, null);         alertdialog.builder builder = new alertdialog.builder(this);         builder.setview(view);          setcontentview(r.layout.city_state_entry);         city = (edittext) findviewbyid(r.id.city);         state = (spinner) findviewbyid(r.id.state_spinner);          button submitbutton = (button) findviewbyid(r.id.submitbutton);         system.err.println("about create onclicklistener");         submitbutton.setontouchlistener(this);           return null;     }      public boolean ontouch(view view, motionevent event) {         system.err.println("inside ontouch");     } 

}

my first println appears, second 1 not. must context setting ontouchlistener, don't know how change it.

use setonclicklistener instead of setontouchlistener handle click events on button. may possible ontouch isn't triggered when button pressed.


Comments