Android : 3 actions 1 button - OnClick Ontouch OnLongClick

on Saturday, September 20, 2014


Im having a problem with logic as to how to go about this.


I require 1 button to do 3 things.



  1. On click --play a music file once

  2. If held (im guessing OnTouch) the music would play and loop but stop on releasing the thumb.

  3. OnLongClick - goes to a new view for user input.


I have been able to implement 1 and 3.


My problem is if i use the onTouchListner it will eventually fire the OnLongClick Event and I think it will try to run the onClick event when I release the touch .


Ant thoughts would apprecieted


0 comments:

Post a Comment