Code example for SparseArray

0
		super(context, attrs);
		initView(); 
	} 
 
	private void initView() { 
		mActivePointers = new SparseArray<PointF>();
		mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
		// set painter color to a color you like 
		mPaint.setColor(Color.BLUE);
		mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
		textPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
		textPaint.setTextSize(20);
	} 
 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
 
		// get pointer index from the event object 
		int pointerIndex = event.getActionIndex();
 
		// get pointer ID