I want to change activity only on a particular gesture on a particular view.
For example on Activity A -
- double tap on View 1 should change current Activity to B
- swipe on View 2 should change current Activity to C
In the OnTouchListener, you can pass the view that triggered the event:
public boolean onTouch(View v, final MotionEvent event){... this.onClick(v); ...}
just call the functions (IE: onClick) and then check if the view is the one you need to trigger this event:
public void onClick(View v){
switch (v.getId()){
case R.id.X: {DO THIS}
case R.id.Y: {DO THAT}
Implement the following Listners
1) GestureDetector.OnDoubleTapListener
2) OnGesturePerformedListener
One for Double Tab and Second listner for Swipe, as you will get unimplemented methods call your activity from there.