code: private void warmUpScaleDetector() {
          long time = System.currentTimeMillis();
          MotionEvent event = MotionEvent.obtain(time, time, MotionEvent.ACTION_CANCEL, 0f, 0f, 0);
          onTouchEvent(event);
          event.recycle();
      }
docs: Scale detector is a little buggy when first time scale is occurred.
  So we will feed it with fake motion event to warm it up.