I get unexpected results when trying to implement multitouch in my application. I never get data for more than one pointer. The multi-touch on my phone certainly works because I can increase the zoom in the browser and detect a pinch gesture with the GestureDetector, but the following samples print action=0 pointers=1
no matter how many fingers I use to touch the screen.
Is there anything in configuration / AndroidManifest or creating activity that I need
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); findViewById(R.id.ll1).setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { Log.d("TAG","onTouch action="+event.getAction()+" pointers="+event.getPointerCount()); return false; } }); }
layout:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ll1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > </LinearLayout>
source share