The problem that i am having is I am using a touch listener for the onTouch event it seems that the touch is being called more than once when i just touch it once. The following is my code
final TextView tv = (TextView)findViewById(R.id.TextView01); tv.setOnTouchListener(new View.OnTouchListener() { int count1 =0; int count2=0; public boolean onTouch(View arg0, MotionEvent event) { Log.d("Code777","Touch is being called finger"); int i = event.getPointerCount(); if(i==1 ) { if(count1==0) { Log.d("Code777","Touched with 1 finger"); count1++; count2=0; } } if (i==2 ) { if(count2==0) { Log.d("Code777","Touched with 2 fingers"); edit.append(tv.getText()); count2++; count1=0; } } return true; } }); Am i doing something wrong ?? It prints the log more than 3-4 times for both single touch and double touch
The problem updated problem is that both the events are getting fired now
if(event.getAction() == MotionEvent.ACTION_POINTER_2_DOWN) { Log.d("Code777","2 finger touch"); return true; }else if(event.getAction() == MotionEvent.ACTION_DOWN) { Log.d("Code777","Touched with 1 finger"); return true; }