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

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -