This article on the Android Developer Blog describes this question very well (scroll down to the GestureDetectors section):
Creating a multi-touch feel
If you just want to implement scaling, you only need a few lines of code:
private ScaleGestureDetector mScaleDetector; private float mScaleFactor = 1.f; public MyCustomView(Context mContext){
The rest of the article is about handling other gestures, but instead of using their implementation, you can use the GestureDetector , since the ScaleGestureDetector is used in the code above.
Alex S Mar 14 '11 at 10:19 2011-03-14 22:19
source share